Merged interactive email interface
authorW. Trevor King <wking@drexel.edu>
Wed, 29 Jul 2009 19:56:10 +0000 (15:56 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 29 Jul 2009 19:56:10 +0000 (15:56 -0400)
15 files changed:
1  2 
becommands/assign.py
becommands/close.py
becommands/comment.py
becommands/depend.py
becommands/merge.py
becommands/open.py
becommands/remove.py
becommands/severity.py
becommands/show.py
becommands/status.py
becommands/tag.py
becommands/target.py
libbe/bugdir.py
libbe/cmdutil.py
libbe/rcs.py

index 81aac2b412db12b246a69c1b385ec8cd20eb683f,ba79aac03e704fa61ba2289a414981a37da5905c..7b32bdd41b891a1e893639f26053fe043b4dc1da
@@@ -53,8 -53,9 +53,10 @@@ def execute(args, manipulate_encodings=
      if len(args) > 2:
          help()
          raise cmdutil.UsageError("Too many arguments.")
-     bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
+     bd = bugdir.BugDir(from_disk=True,
+                        manipulate_encodings=manipulate_encodings)
 +    bug = cmdutil.bug_from_shortname(bd, args[0])
+     bug = bd.bug_from_shortname(args[0])
      if len(args) == 1:
          bug.assigned = bd.user_id
      elif len(args) == 2:
index 327817aca61662536894036ac2de073059a66333,05bdc10f9da7569ff20ec5e1afa2cc29b405e1b2..12848b2ab6d91e80a6874d6e99a11fbce335dd06
@@@ -41,8 -41,9 +41,9 @@@ def execute(args, manipulate_encodings=
          raise cmdutil.UsageError("Please specify a bug id.")
      if len(args) > 1:
          raise cmdutil.UsageError("Too many arguments.")
-     bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
+     bd = bugdir.BugDir(from_disk=True,
+                        manipulate_encodings=manipulate_encodings)
 -    bug = bd.bug_from_shortname(args[0])
 +    bug = cmdutil.bug_from_shortname(bd, args[0])
      bug.status = "closed"
      bd.save()
  
index 4221ef8ba003fc1e4daf4d390cdb24d0eb79ae40,7bbee2c401b77bb7f1fb2fbec20fc36be0c0fae8..14872a3e44e390b07da366542f7ac168a1512435
@@@ -30,9 -30,9 +30,9 @@@ def execute(args, manipulate_encodings=
      >>> import time
      >>> bd = bugdir.simple_bug_dir()
      >>> os.chdir(bd.root)
-     >>> execute(["a", "This is a comment about a"], test=True)
+     >>> execute(["a", "This is a comment about a"], manipulate_encodings=False)
      >>> bd._clear_bugs()
 -    >>> bug = bd.bug_from_shortname("a")
 +    >>> bug = cmdutil.bug_from_shortname(bd, "a")
      >>> bug.load_comments(load_full=False)
      >>> comment = bug.comment_root[0]
      >>> print comment.body
@@@ -52,9 -52,9 +52,9 @@@
      UserError: No comment supplied, and EDITOR not specified.
  
      >>> os.environ["EDITOR"] = "echo 'I like cheese' > "
-     >>> execute(["b"], test=True)
+     >>> execute(["b"], manipulate_encodings=False)
      >>> bd._clear_bugs()
 -    >>> bug = bd.bug_from_shortname("b")
 +    >>> bug = cmdutil.bug_from_shortname(bd, "b")
      >>> bug.load_comments(load_full=False)
      >>> comment = bug.comment_root[0]
      >>> print comment.body
      else:
          bugname = shortname
          is_reply = False
-     
      bd = bugdir.BugDir(from_disk=True,
-                        manipulate_encodings=not test)
+                        manipulate_encodings=manipulate_encodings)
 -    bug = bd.bug_from_shortname(bugname)
 +    bug = cmdutil.bug_from_shortname(bd, bugname)
      bug.load_comments(load_full=False)
      if is_reply:
          parent = bug.comment_root.comment_from_shortname(shortname,
index d22ed2d9d85f69e43302d7d121c9fd8a2d47b6ea,201c2ea17c42a5d958e216936f4ff5c7d0eaf08e..fd38bd1be6566387ec011b7083b4575dc5aa8192
@@@ -47,10 -47,11 +47,11 @@@ def execute(args, manipulate_encodings=
          help()
          raise cmdutil.UsageError("Too many arguments.")
      
-     bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
+     bd = bugdir.BugDir(from_disk=True,
+                        manipulate_encodings=manipulate_encodings)
 -    bugA = bd.bug_from_shortname(args[0])
 +    bugA = cmdutil.bug_from_shortname(bd, args[0])
      if len(args) == 2:
 -        bugB = bd.bug_from_shortname(args[1])
 +        bugB = cmdutil.bug_from_shortname(bd, args[1])
          estrs = bugA.extra_strings
          depend_string = "BLOCKED-BY:%s" % bugB.uuid
          if options.remove == True:
index 633067c36e5c41ec0a80cb6bbd123bf10d7aa424,8e1fd50225175e2a68df09264cdf5e529c1aaf2c..665186906a4f716028cc1838d287e2f1f6677320
@@@ -133,10 -133,11 +133,11 @@@ def execute(args, manipulate_encodings=
          help()
          raise cmdutil.UsageError("Too many arguments.")
      
-     bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
+     bd = bugdir.BugDir(from_disk=True,
+                        manipulate_encodings=manipulate_encodings)
 -    bugA = bd.bug_from_shortname(args[0])
 +    bugA = cmdutil.bug_from_shortname(bd, args[0])
      bugA.load_comments()
 -    bugB = bd.bug_from_shortname(args[1])
 +    bugB = cmdutil.bug_from_shortname(bd, args[1])
      bugB.load_comments()
      mergeA = bugA.new_comment("Merged from bug %s" % bugB.uuid)
      newCommTree = copy.deepcopy(bugB.comment_root)
index 242ceb29274f97282140df5cdf033805bdf1b79c,b98463d055008b31a0c60e1141a0828f76d4e4d0..bfb54ea0f4613b14e7d3e62e8793950b639f5b18
@@@ -40,8 -40,9 +40,9 @@@ def execute(args, manipulate_encodings=
          raise cmdutil.UsageError, "Please specify a bug id."
      if len(args) > 1:
          raise cmdutil.UsageError, "Too many arguments."
-     bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
+     bd = bugdir.BugDir(from_disk=True,
+                        manipulate_encodings=manipulate_encodings)
 -    bug = bd.bug_from_shortname(args[0])
 +    bug = cmdutil.bug_from_shortname(bd, args[0])
      bug.status = "open"
  
  def get_parser():
index 7193119d2688c838ff804006d436b3763e498715,884b792a58c0061b5cc653fc5bd821e872645c6d..bc7b5edc5fcd61e13afc1cdc4ec9bc365f38478a
@@@ -40,8 -40,9 +40,9 @@@ def execute(args, manipulate_encodings=
                               bugid_args={0: lambda bug : bug.active==True})
      if len(args) != 1:
          raise cmdutil.UsageError, "Please specify a bug id."
-     bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
+     bd = bugdir.BugDir(from_disk=True,
+                        manipulate_encodings=manipulate_encodings)
 -    bug = bd.bug_from_shortname(args[0])
 +    bug = cmdutil.bug_from_shortname(bd, args[0])
      bd.remove_bug(bug)
      print "Removed bug %s" % bug.uuid
  
index 74f241df91a03a1871dcc3ff3e22b58a2d6861d4,d1257890d56c00efe04fb79d344a95b1e0cab96c..a14a96be4984b9d95dcdc39a1f4e2b26061d8ed5
@@@ -39,8 -39,9 +39,9 @@@ def execute(args, manipulate_encodings=
      complete(options, args, parser)
      if len(args) not in (1,2):
          raise cmdutil.UsageError
-     bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
+     bd = bugdir.BugDir(from_disk=True,
+                        manipulate_encodings=manipulate_encodings)
 -    bug = bd.bug_from_shortname(args[0])
 +    bug = cmdutil.bug_from_shortname(bd, args[0])
      if len(args) == 1:
          print bug.severity
      elif len(args) == 2:
Simple merge
index bff0626bb346ad265fe6aca6f99c322209cf8c68,56cb50500cdb168a052b9049f125d1ddbc6e6c9c..e4db78763e3562be668d1b5b44dd0313dbf27357
@@@ -36,8 -36,9 +36,9 @@@ def execute(args, manipulate_encodings=
      complete(options, args, parser)
      if len(args) not in (1,2):
          raise cmdutil.UsageError
-     bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
+     bd = bugdir.BugDir(from_disk=True,
+                        manipulate_encodings=manipulate_encodings)
 -    bug = bd.bug_from_shortname(args[0])
 +    bug = cmdutil.bug_from_shortname(bd, args[0])
      if len(args) == 1:
          print bug.status
      else:
Simple merge
Simple merge
diff --cc libbe/bugdir.py
index f7345fd2384c0e33d14ab8c57733c6cc07e2b39c,e9854c9701ac7b77778164d30b60cfc813d580c2..1bb307c941b37b8b67ba82518dfd7bd472a83dff
@@@ -62,12 -63,11 +63,17 @@@ class MultipleBugMatches(ValueError)
          self.shortname = shortname
          self.matches = matches
  
 +class NoBugMatches(KeyError):
 +    def __init__(self, shortname):
 +        msg = "No bug matches %s" % shortname
 +        KeyError.__init__(self, msg)
 +        self.shortname = shortname
 +
+ class DiskAccessRequired (Exception):
+     def __init__(self, goal):
+         msg = "Cannot %s without accessing the disk" % goal
+         Exception.__init__(self, msg)
  
  TREE_VERSION_STRING = "Bugs Everywhere Tree 1 0\n"
  
Simple merge
diff --cc libbe/rcs.py
index 294b8e063e9802cbfeeb1935f445134678ba6f8a,fdbb01adbd436cd2d88abafcee3d98451d70406c..0206bf64f29a7c7fed62c6414ba604ae66f9915a
@@@ -405,16 -413,22 +415,28 @@@ class RCS(object)
          finally:
              os.remove(filename)
          return revision
 -    def precommit(self, directory):
 +    def precommit(self):
 +        """
 +        Executed before all attempted commits.
 +        """
          pass
 -    def postcommit(self, directory):
 +    def postcommit(self):
 +        """
 +        Only executed after successful commits.
 +        """
          pass
+     def revision_id(self, index=None):
+         """
+         Return the name of the <index>th revision.  The choice of
+         which branch to follow when crossing branches/merges is not
+         defined.
+         Return None if index==None, revision IDs are not supported, or
+         if the specified revision does not exist.
+         """
+         if index == None:
+             return None
+         return self._rcs_revision_id(index)
      def _u_any_in_string(self, list, string):
          """
          Return True if any of the strings in list are in string.