lib/rscm/base.rb in rscm-0.3.14 vs lib/rscm/base.rb in rscm-0.3.15
- old
+ new
@@ -14,10 +14,11 @@
# * add
# * checkout
# * checked_out?
# * diff
# * edit
+ # * ls
# * move
# * revisions
# * uptodate?
# * file
# * destroy_working_copy
@@ -106,32 +107,35 @@
#
# This method should throw an exception if the repository cannot be created (for
# example if the repository is 'remote' or if it already exists).
#
def create_central
- raise "Not implemented"
+ raise NotImplementedError
end
# 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
+ raise NotImplementedError
end
# Whether a repository can be created.
def can_create_central?
false
end
# Adds +relative_filename+ to the working copy.
def add(relative_filename)
+ raise NotImplementedError
end
# 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)
+ raise NotImplementedError
end
# Recursively imports files from a +dir+ into the central scm
def import_central(dir, message)
raise "Not implemented"
@@ -141,10 +145,11 @@
def edit(file)
end
# Commit (check in) modified files.
def commit(message)
+ raise NotImplementedError
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
@@ -188,32 +193,27 @@
# Returns a Revisions object for the period specified by +from_identifier+ (exclusive, i.e. after)
# and +to_identifier+ (inclusive). If +relative_path+ is specified, the result will only contain
# revisions pertaining to that path.
#
def revisions(from_identifier, to_identifier=Time.infinity, relative_path=nil)
- # Should be overridden by subclasses
- revisions = Revisions.new
- revisions.add(
- Revision.new(
- "up/the/chimney",
- Revision::DELETED,
- "DamageControl",
- "The #{name} class doesn't\n" +
- "correctly implement the revisions method. This is\n" +
- "not a real revision, but a hint to the developer to go and implement it.\n\n" +
- "Do It Now!",
- "999",
- Time.now.utc
- )
- )
- revisions
+ raise NotImplementedError
end
+ # Returns the HistoricFile representing the root of the repo
+ def rootdir
+ file("", true)
+ end
+
# Returns a HistoricFile for +relative_path+
- def file(relative_path)
- HistoricFile.new(relative_path, self)
+ def file(relative_path, dir)
+ HistoricFile.new(relative_path, dir, self)
end
+
+ # Returns an Array of the children under +relative_path+
+ def ls(relative_path)
+ raise NotImplementedError
+ end
# Whether the working copy is in synch with the central
# repository's revision/time identified by +identifier+.
# If +identifier+ is nil, 'HEAD' of repository should be assumed.
#
@@ -241,50 +241,50 @@
end
alias :can_install_trigger? :supports_trigger?
# Descriptive name of the trigger mechanism
def trigger_mechanism
- "Unknown"
+ raise NotImplementedError
end
# Installs +trigger_command+ in the SCM.
# The +install_dir+ parameter should be an empty local
# directory that the SCM can use for temporary files
# if necessary (CVS needs this to check out its administrative files).
# Most implementations will ignore this parameter.
#
def install_trigger(trigger_command, install_dir)
- raise "Not implemented"
+ raise NotImplementedError
end
# Uninstalls +trigger_command+ from the SCM.
#
def uninstall_trigger(trigger_command, install_dir)
- raise "Not implemented"
+ raise NotImplementedError
end
# Whether the command denoted by +trigger_command+ is installed in the SCM.
#
def trigger_installed?(trigger_command, install_dir)
- raise "Not implemented"
+ raise NotImplementedError
end
# The command line to run in order to check out a fresh working copy.
#
def checkout_commandline(to_identifier=Time.infinity)
- raise "Not implemented"
+ raise NotImplementedError
end
# The command line to run in order to update a working copy.
#
def update_commandline(to_identifier=Time.infinity)
- raise "Not implemented"
+ raise NotImplementedError
end
# Returns/yields an IO containing the unified diff of the change.
# Also see RevisionFile#diff
def diff(change, &block)
- return(yield("Not implemented"))
+ raise NotImplementedError
end
def ==(other_scm)
return false if self.class != other_scm.class
self.instance_variables.each do |var|