"Temporarily lift a master to the working directory."
def __init__(self, name):
self.name = name
+ self.where = os.getcwd()
def __enter__(self):
+ if os.path.dirname(self.name):
+ os.chdir(os.path.dirname(self.name))
do_or_die("mv {0}/{1},v .".format(repodir, self.name))
def __exit__(self, extype, value, traceback_unused):
+ os.chdir(self.where)
if extype and debug > 0:
raise extype(value)
do_or_die("mv {0},v {1}".format(self.name, repodir))
def lifter(self, name):
return RCS.RCSLifter(name)
def history(self, arg):
- if os.sep not in arg:
- return os.path.join(repodir, arg + ",v")
- else:
- return os.path.join(os.path.dirname(arg),
- repodir,
- os.path.basename(arg) + ",v")
+ return os.path.join(os.path.dirname(arg),
+ repodir,
+ os.path.basename(arg) + ",v")
def has_revisions(self, arg):
"Does the master for this file have any revisions"
# The magic number 105 is the size of an empty RCS file (no