lib/origen/revision_control/base.rb in origen-0.31.0 vs lib/origen/revision_control/base.rb in origen-0.32.0
- old
+ new
@@ -14,10 +14,12 @@
class Base
# Returns a pointer to the remote location (a Pathname object)
attr_reader :remote
# Returns a pointer to the local location (a Pathname object)
attr_reader :local
+ # Method to use by Origen::RemoteManager to handle fetching a remote file
+ attr_reader :remotes_method
# rubocop:disable Lint/UnusedMethodArgument
# All revision control instances represent a remote server mapping
# to a local directory, :remote and :local options are required
@@ -25,10 +27,11 @@
unless options[:remote] && options[:local]
fail ':remote and :local options must be supplied when instantiating a new RevisionControl object'
end
@remote = Pathname.new(options[:remote])
@local = Pathname.new(options[:local]).expand_path
+ @remotes_method = :checkout
initialize_local_dir(options)
end
# Build the local workspace for the first time.
#
@@ -189,9 +192,15 @@
# Returns true if the revision controller object uses Git
def git?
is_a?(Git) # :-)
end
+
+ # Returns true if the revision controller object uses Perforce
+ def p4?
+ is_a?(Perforce)
+ end
+ alias_method :perforce?, :p4?
# Returns true if the revision controller object uses Subversion
def svn?
is_a?(Subversion) # :-)
end