aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/diff.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2012-08-29 23:26:17 -0400
committerW. Trevor King <wking@tremily.us>2012-08-29 23:31:03 -0400
commit4db1a045a0606bead191a563abc54dfa8352efe0 (patch)
tree51c891d731555340ffd4432cd889fb67795ae1b6 /libbe/command/diff.py
parent5a32d82284e54facf2f5dcb03ba37afe3805a609 (diff)
downloadbugseverywhere-4db1a045a0606bead191a563abc54dfa8352efe0.tar.gz
Rewrite commands to use bugdirs instead of a single bugdir.
The bulk of the work is in regard to XML, with new BugDir.xml and .from_xml methods to support the new <bugdir> entity. I also split the guts import_xml's ._run method into sub-methods to make the import logic more obvious.
Diffstat (limited to 'libbe/command/diff.py')
-rw-r--r--libbe/command/diff.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/libbe/command/diff.py b/libbe/command/diff.py
index 991a206..0d03ebf 100644
--- a/libbe/command/diff.py
+++ b/libbe/command/diff.py
@@ -91,11 +91,16 @@ class Diff (libbe.command.Command):
params['subscribe'])
except ValueError, e:
raise libbe.command.UserError(e.msg)
- bugdir = self._get_bugdir()
- if bugdir.storage.versioned == False:
- raise libbe.command.UserError(
- 'This repository is not revision-controlled.')
+ bugdirs = self._get_bugdirs()
+ for uuid,bugdir in sorted(bugdirs.items()):
+ self.diff(bugdir, subscriptions, params=params)
+
+
+ def diff(self, bugdir, subscriptions, params):
if params['repo'] == None:
+ if bugdir.storage.versioned == False:
+ raise libbe.command.UserError(
+ 'This repository is not revision-controlled.')
if params['revision'] == None: # get the most recent revision
params['revision'] = bugdir.storage.revision_id(-1)
old_bd = libbe.bugdir.RevisionedBugDir(bugdir, params['revision'])
@@ -108,8 +113,8 @@ class Diff (libbe.command.Command):
else:
if old_bd_current.storage.versioned == False:
raise libbe.command.UserError(
- '%s is not revision-controlled.'
- % storage.repo)
+ '{} is not revision-controlled.'.format(
+ bugdir.storage.repo))
old_bd = libbe.bugdir.RevisionedBugDir(old_bd_current,revision)
d = libbe.diff.Diff(old_bd, bugdir)
tree = d.report_tree(subscriptions)