diff options
author | W. Trevor King <wking@drexel.edu> | 2009-07-21 07:28:26 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-07-21 07:28:26 -0400 |
commit | 4c7a9d837a268480e61124bba84b5fb01ec3728f (patch) | |
tree | eb20c2f424a0b334316e25fa179d2307befba66d /libbe/rcs.py | |
parent | 9ef6ad576c01444e35b91dfee8d05b39ec911d45 (diff) | |
download | bugseverywhere-4c7a9d837a268480e61124bba84b5fb01ec3728f.tar.gz |
Cleaned up saving/sync_with_disk.
Got rid of a whole bunch of redundant .save() calls when
sync_with_disk==True.
Fixed up the "File-system access" portion of the BugDir docstring so
we can all remember how things are supposed to work ;).
Note that some .save() calls are still required. For example in
becommands/merge.py, the copied comments have their .bug changed, but
that is not a versioned property, so it doesn't trigger an automatic
save, and we have to force the .save() by hand.
libbe.rcs.RCS.mkdir() is now recursive by default, but you can set
check_parents==False if you want it to fail in the case of missing
parents. Because of the recursion, we removed the .update() call
on preexisting directories, since there will be at least one of
these occurrences for every .mkdir(check_parents=True) call, and
I don't know of any VCS that actually needs them...
Also stripped trailing whitespace from some files...
Diffstat (limited to 'libbe/rcs.py')
-rw-r--r-- | libbe/rcs.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libbe/rcs.py b/libbe/rcs.py index 3bf8c9d..1e1cfa7 100644 --- a/libbe/rcs.py +++ b/libbe/rcs.py @@ -339,11 +339,15 @@ class RCS(object): self.add(path) else: self.update(path) - def mkdir(self, path, allow_no_rcs=False): + def mkdir(self, path, allow_no_rcs=False, check_parents=True): """ Create (if neccessary) a directory at path under version control. """ + if check_parents == True: + parent = os.path.dirname(path) + if not os.path.exists(parent): # recurse through parents + self.mkdir(parent, allow_no_rcs, check_parents) if not os.path.exists(path): os.mkdir(path) if self._use_rcs(path, allow_no_rcs): @@ -351,7 +355,9 @@ class RCS(object): else: assert os.path.isdir(path) if self._use_rcs(path, allow_no_rcs): - self.update(path) + #self.update(path)# Don't update directories. Changing files + pass # underneath them should be sufficient. + def duplicate_repo(self, revision=None): """ Get the repository as it was in a given revision. |