diff options
author | W. Trevor King <wking@drexel.edu> | 2009-12-29 04:43:42 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-12-29 04:43:42 -0500 |
commit | d1726c47dccc7a7c7db1f038bc30a5712bb70153 (patch) | |
tree | 2c9d58c568f07a45c48790fa5668e80850a9a80d /libbe | |
parent | e0e7328742b92cb5e08aeec348fce966375d7d52 (diff) | |
download | bugseverywhere-d1726c47dccc7a7c7db1f038bc30a5712bb70153.tar.gz |
Adapted BugDir.duplicate_bugdir() to use revision-dependend Storage.children()
Diffstat (limited to 'libbe')
-rw-r--r-- | libbe/bugdir.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libbe/bugdir.py b/libbe/bugdir.py index 50dc8ba..cec1e3b 100644 --- a/libbe/bugdir.py +++ b/libbe/bugdir.py @@ -300,17 +300,23 @@ class BugDir (list, settings_object.SavedSettingsObject): raise libbe.storage.InvalidStorageVersion(storage_version) s = copy.deepcopy(self.storage) s.writeable = False - class RevisionedStorageGet (object): + class RevisionedStorage (object): def __init__(self, storage, default_revision): self.s = storage self.sget = self.s.get + self.schildren = self.s.children self.r = default_revision def get(self, *args, **kwargs): if not 'revision' in kwargs or kwargs['revision'] == None: kwargs['revision'] = self.r return self.sget(*args, **kwargs) - rsg = RevisionedStorageGet(s, revision) - s.get = rsg.get + def children(self, *args, **kwargs): + if not 'revision' in kwargs or kwargs['revision'] == None: + kwargs['revision'] = self.r + return self.schildren(*args, **kwargs) + rs = RevisionedStorage(s, revision) + s.get = rs.get + s.children = rs.children dbd = BugDir(s, from_storage=True) # dbd = copy.copy(self) # dbd.storage = copy.copy(self.storage) |