lib/rscm/base.rb in rscm-0.3.0 vs lib/rscm/base.rb in rscm-0.3.1
- old
+ new
@@ -10,37 +10,39 @@
#
# Concrete subclasses of this class provide an API to manage a local working copy
# as well as an associated 'central' repository. The main responsibility is working
# copy operations:
#
+ # * add
# * checkout
- # * revisions
- # * uptodate?
# * checked_out?
# * diff
# * edit
+ # * move
+ # * revisions
+ # * uptodate?
#
# In addition to operations related to working copies, the same instance should provide
# methods to administer the working copy's associated 'central' repository. These are:
#
# * central_exists?
# * create_central
# * can_create_central?
# * import_central
+ # * install_trigger
# * supports_trigger? # TODO: rename to can_install_trigger?
# * trigger_installed?
- # * install_trigger
# * uninstall_trigger
#
# Some methods are a bit fuzzy with respect to their relevance to the working copy or
# the associated central repository, as it depends on the nature of the individual underlying
# SCMs. These methods are:
#
+ # * checkout_command_line
# * label
# * name
# * transactional?
- # * checkout_command_line
# * update_command_line
#
# Some of the methods in this API use +from_identifier+ and +to_identifier+.
# These identifiers can be either a UTC Time (according to the SCM's clock)
# or a String or Integer representing a label/revision
@@ -50,11 +52,10 @@
# Time.epoch or Time.infinite.
#
# TODO: rename this superclass to 'Base'
#
class Base
- include FileUtils
@@classes = []
def self.register(cls)
@@classes << cls unless @@classes.index(cls)
end
@@ -108,40 +109,41 @@
#
def create_central
raise "Not implemented"
end
- # Destroysthe central repository. Shuts down any server processes and deletes the repository.
- # WARNING: calling this may result in loss of data. Only call this if you really want to wipe it out for good!
+ # Destroys the central repository. Shuts down any server processes and deletes the repository.
+ # WARNING: calling this may result in loss of data. Only call this if you really want to wipe
+ # it out for good!
def destroy_central
end
# Whether a repository can be created.
- #
def can_create_central?
false
end
# Adds +relative_filename+ to the working copy.
def add(relative_filename)
end
- # Recursively imports files from a directory into the central scm
- #
+ # Schedules a move of +relative_src+ to +relative_dest+
+ # Should not take effect in the central repository until
+ # +commit+ is invoked.
+ def move(relative_src, relative_dest)
+ end
+
+ # Recursively imports files from a +dir+ into the central scm
def import_central(dir, message)
raise "Not implemented"
end
- # The display name of this SCM
- #
- def name
- # Should be overridden by subclasses to display a nicer name
- self.class.name
- end
-
- # Open a file for edit - required by scms that checkout files in read-only mode e.g. perforce
- #
+ # Open a file for edit - required by scms that check out files in read-only mode e.g. perforce
def edit(file)
+ end
+
+ # Commit (check in) modified files.
+ def commit(message)
end
# Checks out or updates contents from a central SCM to +checkout_dir+ - a local working copy.
# If this is a distributed SCM, this method should create a 'working copy' repository
# if one doesn't already exist. Then the contents of the central SCM should be pulled into