be --dir DIR COMMAND now roots the bugdir in DIR without changing directories.
authorW. Trevor King <wking@drexel.edu>
Mon, 7 Dec 2009 12:18:48 +0000 (07:18 -0500)
committerW. Trevor King <wking@drexel.edu>
Mon, 7 Dec 2009 12:18:48 +0000 (07:18 -0500)
Previously, for the directory structure
  A
  |-- X
  `-- Y
You could do something like
  A$ be --dir X diff --dir ../Y
Now it's
  A$ be --dir X diff --dir Y

The --root option to `be init` has been removed as redundant.  Replace
calls like
  be init --root DIR
with
  be --dir DIR init

30 files changed:
.be/bugs/52034fd0-ec50-424d-b25d-2beaf2d2c317/comments/79fb6ef2-176c-45c0-b898-59c3c3e0aafe/body [new file with mode: 0644]
.be/bugs/52034fd0-ec50-424d-b25d-2beaf2d2c317/comments/79fb6ef2-176c-45c0-b898-59c3c3e0aafe/values [new file with mode: 0644]
NEWS
README.dev
be
becommands/assign.py
becommands/close.py
becommands/comment.py
becommands/commit.py
becommands/depend.py
becommands/diff.py
becommands/due.py
becommands/email_bugs.py
becommands/help.py
becommands/html.py
becommands/import_xml.py
becommands/init.py
becommands/list.py
becommands/merge.py
becommands/new.py
becommands/open.py
becommands/remove.py
becommands/set.py
becommands/severity.py
becommands/show.py
becommands/status.py
becommands/subscribe.py
becommands/tag.py
becommands/target.py
libbe/cmdutil.py

diff --git a/.be/bugs/52034fd0-ec50-424d-b25d-2beaf2d2c317/comments/79fb6ef2-176c-45c0-b898-59c3c3e0aafe/body b/.be/bugs/52034fd0-ec50-424d-b25d-2beaf2d2c317/comments/79fb6ef2-176c-45c0-b898-59c3c3e0aafe/body
new file mode 100644 (file)
index 0000000..7dbeebb
--- /dev/null
@@ -0,0 +1,13 @@
+>   * Determining what to commit.
+> 
+>     You'd have to have RCS keep a log of all versioned files it
+>     touched, and extend .commit() to accept the keyword list "files"
+>     and commit only those files.  This is doable, but maybe not worth
+>     the trouble.
+
+On the other hand, just attemting to commit evverything after each
+command would make it nice and easy to commit bug fixes:
+  be --auto-commit status XYZ fixed
+which would commit whatever changes you had outstanding with an
+appropriate commit message.
+
diff --git a/.be/bugs/52034fd0-ec50-424d-b25d-2beaf2d2c317/comments/79fb6ef2-176c-45c0-b898-59c3c3e0aafe/values b/.be/bugs/52034fd0-ec50-424d-b25d-2beaf2d2c317/comments/79fb6ef2-176c-45c0-b898-59c3c3e0aafe/values
new file mode 100644 (file)
index 0000000..b3dba3f
--- /dev/null
@@ -0,0 +1,11 @@
+Author: W. Trevor King <wking@drexel.edu>
+
+
+Content-type: text/plain
+
+
+Date: Sun, 06 Dec 2009 21:45:15 +0000
+
+
+In-reply-to: 4c50ca0b-a08f-4723-b00d-4bf342cf86b6
+
diff --git a/NEWS b/NEWS
index 0cf9aae57b2e73658c20b3b005477f48546e0e3d..84256e19afd78b702219f633f24ca8e44b2593d2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+December 6, 2009
+ * be --dir DIR COMMAND now roots the bugdir in DIR _without_ changing
+   directories.
+ * `be init --root DIR` should now be `be --dir DIR init`.
+
 December 5, 2009
  * targets are now a special type of bug (severity 'target'), so you
    can do all the things you do with normal bugs to them as well
index fb4f4714795f21e11e11ef6db6b66e89a9bb2866..dbb97b06a3bfd722a60292e25a72bb59188465cb 100644 (file)
@@ -10,7 +10,8 @@ To fit into the current framework, your extension module should
 provide the following elements:
   __desc__
     A short string describing the purpose of your plugin
-  execute(args, manipulate_encodings=True, restrict_file_access=False)
+  execute(args, manipulate_encodings=True, restrict_file_access=False,
+          dir=".")
     The entry function for your plugin.  args is everything from
     sys.argv after the name of your plugin (e.g. for the command
     `be open abc', args=['abc']).
@@ -23,6 +24,8 @@ provide the following elements:
     before attempting to read or write a file.  See the
     restrict_file_access documentation for details.
 
+    dir is a directory inside the repository of interest.
+
     Note: be supports command-completion.  To avoid raising errors you
     need to deal with possible '--complete' options and arguments.
     See the 'Command completion' section below for more information.
diff --git a/be b/be
index c5c372f288a05a2918098b8623713bd498fece99..8a594cf1bcae9551e9142c3f1bead7169f12dd81 100755 (executable)
--- a/be
+++ b/be
@@ -34,8 +34,8 @@ parser.add_option("--version", action="store_true", dest="version",
                   help="Print version string and exit.")
 parser.add_option("--verbose-version", action="store_true", dest="verbose_version",
                   help="Print verbose version information and exit.")
-parser.add_option("-d", "--dir", dest="dir", metavar="DIR",
-                  help="Run this command from DIR instead of the current directory.")
+parser.add_option("-d", "--dir", dest="dir", metavar="DIR", default=".",
+                  help="Run this command on the repository in DIR instead of the current directory.")
 
 try:
     options,args = parser.parse_args()
@@ -56,13 +56,11 @@ except cmdutil.GetCompletions, e:
 if options.version == True or options.verbose_version == True:
     print version.version(verbose=options.verbose_version)
     sys.exit(0)
-if options.dir != None:
-    os.chdir(options.dir)
 
 try:
     if len(args) == 0:
         raise cmdutil.UsageError, "must supply a command"
-    sys.exit(cmdutil.execute(args[0], args[1:]))
+    sys.exit(cmdutil.execute(args[0], args=args[1:], dir=options.dir))
 except cmdutil.GetHelp:
     print cmdutil.help(args[0])
     sys.exit(0)
index 2c78f69a1b09d0b10847d09f06d8ad447ecb359c..9c971ae159da75b33dda86f4374a075a26589739 100644 (file)
@@ -21,7 +21,8 @@
 from libbe import cmdutil, bugdir
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os
     >>> bd = bugdir.SimpleBugDir()
@@ -56,7 +57,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
         help()
         raise cmdutil.UsageError("Too many arguments.")
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     bug = cmdutil.bug_from_id(bd, args[0])
     bug = bd.bug_from_shortname(args[0])
     if len(args) == 1:
index a14cea8015679b814b5f2a1a91b2d4d31104b2eb..026c605a0351517f99ae622708ced662f83e5cf7 100644 (file)
@@ -21,7 +21,8 @@
 from libbe import cmdutil, bugdir
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> from libbe import bugdir
     >>> import os
@@ -44,7 +45,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     if len(args) > 1:
         raise cmdutil.UsageError("Too many arguments.")
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     bug = cmdutil.bug_from_id(bd, args[0])
     bug.status = "closed"
     bd.save()
index fbc994f38bf5bddfcad9fe58973678176f1aeeb5..9919d1d264c7fd920de2eae29dbb12560131482e 100644 (file)
@@ -21,7 +21,8 @@ import os
 import sys
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import time
     >>> bd = bugdir.SimpleBugDir()
@@ -69,7 +70,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     shortname = args[0]
 
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     bug, parent = cmdutil.bug_comment_from_id(bd, shortname)
 
     if len(args) == 1: # try to launch an editor for comment-body entry
index 39d1e2e9eea7c3c0a0e7c5274bc7d29b361fef68..cade3556b3c459d3fe21830181a238641271e561 100644 (file)
@@ -18,7 +18,8 @@ from libbe import cmdutil, bugdir, editor, vcs
 import sys
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os
     >>> from libbe import bug
@@ -37,7 +38,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     if len(args) != 1:
         raise cmdutil.UsageError("Please supply a commit message")
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     if args[0] == '-': # read summary from stdin
         assert options.body != "EDITOR", \
           "Cannot spawn and editor when the summary is using stdin."
index 6336793d8d104338d939ea4ba21737a30559a518..c2cb2a4af5209bce2774e70319ffa6ddc23a14ef 100644 (file)
@@ -35,7 +35,8 @@ class BrokenLink (Exception):
         self.blocking_bug = blocking_bug
 
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> from libbe import utility
     >>> bd = bugdir.SimpleBugDir()
@@ -84,7 +85,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
         raise cmdutil.UsageError("Only one bug id used in tree mode.")
 
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     if options.repair == True:
         good,fixed,broken = check_dependencies(bd, repair_broken_links=True)
         assert len(broken) == 0, broken
index e844c105469f13f307a75cfcba13111302586bf8..c5c34f9e9bd5536618d3ee35f36d9bf732e6614e 100644 (file)
@@ -21,7 +21,8 @@ from libbe import cmdutil, bugdir, diff
 import os
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os
     >>> bd = bugdir.SimpleBugDir()
@@ -69,7 +70,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     except ValueError, e:
         raise cmdutil.UsageError(e.msg)
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     if bd.vcs.versioned == False:
         raise cmdutil.UsageError('This directory is not revision-controlled.')
     if options.dir == None:
index 6f11ad4c3ef815d513877d9584b2fda42c02d1d6..0b8d1e9e3a4a0afcc7140daac83302ffd9062860 100644 (file)
@@ -19,7 +19,8 @@ __desc__ = __doc__
 
 DUE_TAG="DUE:"
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os
     >>> bd = bugdir.SimpleBugDir()
@@ -43,7 +44,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     if len(args) not in (1, 2):
         raise cmdutil.UsageError('Incorrect number of arguments.')
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     bug = cmdutil.bug_from_id(bd, args[0])
     if len(args) == 1:
         due_time = get_due(bug)
index d0366df762e8e970f8e6da52285e19e80164702c..f6641e305ea10ad04fb72ba602b4f5faa8f15c0e 100644 (file)
@@ -33,7 +33,8 @@ __desc__ = __doc__
 
 sendmail='/usr/sbin/sendmail -t'
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os
     >>> from libbe import bug
@@ -96,7 +97,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     if len(args) == 0:
         raise cmdutil.UsageError
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     xml = show.output(args, bd, as_xml=True, with_comments=True)
     subject = options.subject
     if subject == None:
index 99ab8c4a7151445931b39921c30162cdb57cbec5..9e6d1aafb6edd85bae0452268b769d09c8f83a63 100644 (file)
@@ -20,7 +20,8 @@
 from libbe import cmdutil, utility
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     Print help of specified command (the manipulate_encodings argument
     is ignored).
index a0311887d96d80c960c5c9595ee6007876dd7174..d9e0d73934cc2095041a4c4f74d19184788bb42e 100644 (file)
@@ -21,7 +21,8 @@ import xml.sax.saxutils, htmlentitydefs
 
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os
     >>> bd = bugdir.SimpleBugDir()
@@ -50,7 +51,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
         raise cmdutil.UsageError, 'Too many arguments.'
 
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     bd.load_all_bugs()
 
     html_gen = HTMLGen(bd, template=options.template, verbose=options.verbose,
index d1ea0267890ed6e62cea642128c2fe0fb39aba24..b985193d51964b0832713b2c3bc8604f8db9c3d1 100644 (file)
@@ -29,7 +29,8 @@ if libbe.TESTING == True:
     import unittest
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import time
     >>> import StringIO
@@ -64,7 +65,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     filename = args[0]
 
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     if options.comment_root != None:
         croot_bug,croot_comment = \
             cmdutil.bug_comment_from_id(bd, options.comment_root)
index 60852869ab47c9328eb0c48c77a30c515ff4efec..ab9255b305d45c834f6d69904696784b911dcb7a 100644 (file)
@@ -20,7 +20,8 @@ import os.path
 from libbe import cmdutil, bugdir
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> from libbe import utility, vcs
     >>> import os
@@ -30,7 +31,7 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     ... except bugdir.NoBugDir, e:
     ...     True
     True
-    >>> execute(['--root', dir.path], manipulate_encodings=False)
+    >>> execute([], manipulate_encodings=False, dir=dir.path)
     No revision control detected.
     Directory initialized.
     >>> dir.cleanup()
@@ -47,11 +48,12 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     >>> _vcs.cleanup()
 
     >>> try:
-    ...     execute(['--root', '.'], manipulate_encodings=False)
+    ...     execute([], manipulate_encodings=False, dir=".")
     ... except cmdutil.UserError, e:
     ...     str(e).startswith("Directory already initialized: ")
     True
-    >>> execute(['--root', '/highly-unlikely-to-exist'], manipulate_encodings=False)
+    >>> execute([], manipulate_encodings=False,
+    ...         dir='/highly-unlikely-to-exist')
     Traceback (most recent call last):
     UserError: No such directory: /highly-unlikely-to-exist
     >>> os.chdir('/')
@@ -63,14 +65,15 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     if len(args) > 0:
         raise cmdutil.UsageError
     try:
-        bd = bugdir.BugDir(options.root_dir, from_disk=False,
+        bd = bugdir.BugDir(from_disk=False,
                            sink_to_existing_root=False,
                            assert_new_BugDir=True,
-                           manipulate_encodings=manipulate_encodings)
+                           manipulate_encodings=manipulate_encodings,
+                           root=dir)
     except bugdir.NoRootEntry:
-        raise cmdutil.UserError("No such directory: %s" % options.root_dir)
+        raise cmdutil.UserError("No such directory: %s" % dir)
     except bugdir.AlreadyInitialized:
-        raise cmdutil.UserError("Directory already initialized: %s" % options.root_dir)
+        raise cmdutil.UserError("Directory already initialized: %s" % dir)
     bd.save()
     if bd.vcs.name is not "None":
         print "Using %s for revision control." % bd.vcs.name
@@ -80,9 +83,6 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
 
 def get_parser():
     parser = cmdutil.CmdOptionParser("be init")
-    parser.add_option("-r", "--root", metavar="DIR", dest="root_dir",
-                      help="Set root dir to something other than the current directory.",
-                      default=".")
     return parser
 
 longhelp="""
@@ -90,7 +90,9 @@ This command initializes Bugs Everywhere support for the specified directory
 and all its subdirectories.  It will auto-detect any supported revision control
 system.  You can use "be set vcs_name" to change the vcs being used.
 
-The directory defaults to your current working directory.
+The directory defaults to your current working directory, but you can
+change that by passing the --dir option to be
+  $ be --dir path/to/new/bug/root init
 
 It is usually a good idea to put the Bugs Everywhere root at the source code
 root, but you can put it anywhere.  If you root Bugs Everywhere in a
index fa5647b44a87ce7695767117847bac4783838869..1c3e78d751e711e5b38d04b26495957a856fbf0c 100644 (file)
@@ -26,7 +26,8 @@ __desc__ = __doc__
 AVAILABLE_CMPS = [fn[4:] for fn in dir(bug) if fn[:4] == 'cmp_']
 AVAILABLE_CMPS.remove("attr") # a cmp_* template.
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os
     >>> bd = bugdir.SimpleBugDir()
@@ -52,7 +53,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
             cmp_list.append(eval('bug.cmp_%s' % cmp))
     
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     bd.load_all_bugs()
     # select status
     if options.status != None:
index 8cf7e2fe09f8cd2f112e85e8ea543b2443252c8b..ac09b407932315172e2d0d4205bc13f42323ff00 100644 (file)
@@ -19,7 +19,8 @@ from libbe import cmdutil, bugdir
 import os, copy
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> from libbe import utility
     >>> bd = bugdir.SimpleBugDir()
@@ -134,7 +135,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
         raise cmdutil.UsageError("Too many arguments.")
     
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     bugA = cmdutil.bug_from_id(bd, args[0])
     bugA.load_comments()
     bugB = cmdutil.bug_from_id(bd, args[1])
index 00e8a47008ea9691b6e1e9db13953da8d307163b..30f883435e233299e6795aaf693ab28c3c40479d 100644 (file)
@@ -20,7 +20,8 @@ from libbe import cmdutil, bugdir
 import sys
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os, time
     >>> from libbe import bug
@@ -47,7 +48,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     if len(args) != 1:
         raise cmdutil.UsageError("Please supply a summary message")
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     if args[0] == '-': # read summary from stdin
         summary = sys.stdin.readline()
     else:
index c2c15e2918ef5646b1e1988babaa406348895283..a6fe48d2a207e870d575bce8975c7cb95e8e4d3e 100644 (file)
@@ -21,7 +21,8 @@
 from libbe import cmdutil, bugdir
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os
     >>> bd = bugdir.SimpleBugDir()
@@ -43,7 +44,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     if len(args) > 1:
         raise cmdutil.UsageError, "Too many arguments."
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     bug = cmdutil.bug_from_id(bd, args[0])
     bug.status = "open"
 
index e4f006534f1af8627de27f6bbdd471274461c1d0..bac06c0ad42db1fe0326764a975f1301eebeb61f 100644 (file)
@@ -18,7 +18,8 @@
 from libbe import cmdutil, bugdir
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> from libbe import mapfile
     >>> import os
@@ -43,7 +44,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     if len(args) != 1:
         raise cmdutil.UsageError, "Please specify a bug id."
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     bug = cmdutil.bug_from_id(bd, args[0])
     bd.remove_bug(bug)
     print "Removed bug %s" % bug.uuid
index c8c5a2cab339570ec4fed38aef0c8cc3cac2bd9c..4d54a594ba2093b3102151b061f496c4ae52964f 100644 (file)
@@ -32,7 +32,8 @@ def _value_string(bd, setting):
             val = None
     return str(val)
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os
     >>> bd = bugdir.SimpleBugDir()
@@ -53,7 +54,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     if len(args) > 2:
         raise cmdutil.UsageError, "Too many arguments"
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     if len(args) == 0:
         keys = bd.settings_properties
         keys.sort()
index 524976beb08a94af47eed2898a7575e07bdfbf58..804dc4eafd896bb04cf1069664f9fd17cb8aa964 100644 (file)
@@ -21,7 +21,8 @@
 from libbe import cmdutil, bugdir, bug
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os
     >>> bd = bugdir.SimpleBugDir()
@@ -42,7 +43,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     if len(args) not in (1,2):
         raise cmdutil.UsageError
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     bug = cmdutil.bug_from_id(bd, args[0])
     if len(args) == 1:
         print bug.severity
index ab1708fa9891eabd85cdebedbb202564eb52cf46..7757aaa73226fdba7dea1cbf49106afb1cf6f36f 100644 (file)
@@ -22,7 +22,8 @@ import sys
 from libbe import cmdutil, bugdir, comment, version, _version
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os
     >>> bd = bugdir.SimpleBugDir()
@@ -66,7 +67,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     if len(args) == 0:
         raise cmdutil.UsageError
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
 
     if options.only_raw_body == True:
         if len(args) != 1:
index fd31c97a8fa0fe0c058204857d261e68d82ceda2..58b6f63670589701a9de8936c35ef94e65918f5c 100644 (file)
@@ -18,7 +18,8 @@
 from libbe import cmdutil, bugdir, bug
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os
     >>> bd = bugdir.SimpleBugDir()
@@ -39,7 +40,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
     if len(args) not in (1,2):
         raise cmdutil.UsageError
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     bug = cmdutil.bug_from_id(bd, args[0])
     if len(args) == 1:
         print bug.status
index 19aac53b768a340a16fd44bd36364e5ce4720286..69554f7bec7c53ebeee417aadcaec5c35f28907d 100644 (file)
@@ -20,7 +20,8 @@ __desc__ = __doc__
 
 TAG="SUBSCRIBE:"
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> bd = bugdir.SimpleBugDir()
     >>> bd.set_sync_with_disk(True)
@@ -73,7 +74,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
         raise cmdutil.UsageError("Too many arguments.")
 
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
 
     subscriber = options.subscriber
     if subscriber == None:
index e22cb70b2c5eba2a0817c3a7ee62708f1e3335bb..f3819bde4c2b7bb025ddac66fbaacac032386720 100644 (file)
@@ -19,7 +19,8 @@ from libbe import cmdutil, bugdir
 import os, copy
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> from libbe import utility
     >>> bd = bugdir.SimpleBugDir()
@@ -81,7 +82,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
         raise cmdutil.UsageError("Too many arguments.")
     
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     if options.list:
         bd.load_all_bugs()
         tags = []
index 9ccbacc0d12a46ad68df8e5627dded4ace47f7b8..5dd5d38f5d2e4b3f1064283f5857742fb3f4be21 100644 (file)
@@ -23,7 +23,8 @@ from libbe import cmdutil, bugdir
 from becommands import depend
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True, restrict_file_access=False):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os, StringIO, sys
     >>> bd = bugdir.SimpleBugDir()
@@ -60,7 +61,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False):
             or (options.resolve == True and len(args) not in (0, 1)):
             raise cmdutil.UsageError('Incorrect number of arguments.')
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
     if options.resolve == True:
         if len(args) == 0:
             summary = None
index b892bdec966cd605d84dec90e4a14c807e3df32d..c56798480482d092cbfa12711fd6bb136aadeb36 100644 (file)
@@ -79,12 +79,15 @@ def get_command(command_name):
     return cmd
 
 
-def execute(cmd, args, manipulate_encodings=True, restrict_file_access=False):
+def execute(cmd, args,
+            manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     enc = encoding.get_encoding()
     cmd = get_command(cmd)
     ret = cmd.execute([a.decode(enc) for a in args],
                       manipulate_encodings=manipulate_encodings,
-                      restrict_file_access=restrict_file_access)
+                      restrict_file_access=restrict_file_access,
+                      dir=dir)
     if ret == None:
         ret = 0
     return ret