aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/init.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-07-16 05:50:31 -0400
committerW. Trevor King <wking@drexel.edu>2009-07-16 05:50:31 -0400
commitdfb7878b674e8eed1cfa55928d5464dc6fb0f085 (patch)
tree7544d8433e20167c184bffda64dd8e3455e96d53 /becommands/init.py
parentb39f68dcb0ecdc5f2c3f12fe75b47ff1f4d51e86 (diff)
downloadbugseverywhere-dfb7878b674e8eed1cfa55928d5464dc6fb0f085.tar.gz
Renamed test->manipulate_encodings in becommands.*.execute.
Reminder from my initial libbe/encoding.py commit: Because of the stdout replacement, the doctests executes now need an optional 'test' argument to turn off replacement during the doctests, otherwise doctest flips out (since it had set up stdout to catch output, and then we clobbered it's setup). I'm also trying to catch stdout/stderr from be-handle-mail, and I ran into the same problem. It took me a bit to remember exactly what "test" was supposed to do, so I thought I'd make the argument name more specific. If you need other changes when running in "test" mode, you'll have to add other kwargs.
Diffstat (limited to 'becommands/init.py')
-rw-r--r--becommands/init.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/becommands/init.py b/becommands/init.py
index 5b2a416..4156a26 100644
--- a/becommands/init.py
+++ b/becommands/init.py
@@ -19,7 +19,7 @@ import os.path
from libbe import cmdutil, bugdir
__desc__ = __doc__
-def execute(args, test=False):
+def execute(args, manipulate_encodings=True):
"""
>>> from libbe import utility, rcs
>>> import os
@@ -29,7 +29,7 @@ def execute(args, test=False):
... except bugdir.NoBugDir, e:
... True
True
- >>> execute(['--root', dir.path], test=True)
+ >>> execute(['--root', dir.path], manipulate_encodings=False)
No revision control detected.
Directory initialized.
>>> del(dir)
@@ -40,17 +40,17 @@ def execute(args, test=False):
>>> rcs.init('.')
>>> print rcs.name
Arch
- >>> execute([], test=True)
+ >>> execute([], manipulate_encodings=False)
Using Arch for revision control.
Directory initialized.
>>> rcs.cleanup()
>>> try:
- ... execute(['--root', '.'], test=True)
+ ... execute(['--root', '.'], manipulate_encodings=False)
... except cmdutil.UserError, e:
... str(e).startswith("Directory already initialized: ")
True
- >>> execute(['--root', '/highly-unlikely-to-exist'], test=True)
+ >>> execute(['--root', '/highly-unlikely-to-exist'], manipulate_encodings=False)
Traceback (most recent call last):
UserError: No such directory: /highly-unlikely-to-exist
>>> os.chdir('/')
@@ -64,7 +64,7 @@ def execute(args, test=False):
bd = bugdir.BugDir(options.root_dir, from_disk=False,
sink_to_existing_root=False,
assert_new_BugDir=True,
- manipulate_encodings=not test)
+ manipulate_encodings=manipulate_encodings)
except bugdir.NoRootEntry:
raise cmdutil.UserError("No such directory: %s" % options.root_dir)
except bugdir.AlreadyInitialized: