From fdf9925ffaada614544d1b2d3ccecb42f1549acb Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 7 Dec 2009 07:18:48 -0500 Subject: be --dir DIR COMMAND now roots the bugdir in DIR without changing directories. 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 --- be | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'be') diff --git a/be b/be index c5c372f..8a594cf 100755 --- 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) -- cgit