From dfb7878b674e8eed1cfa55928d5464dc6fb0f085 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 16 Jul 2009 05:50:31 -0400 Subject: 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. --- becommands/diff.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'becommands/diff.py') diff --git a/becommands/diff.py b/becommands/diff.py index f3474b3..20fcb4c 100644 --- a/becommands/diff.py +++ b/becommands/diff.py @@ -20,7 +20,7 @@ from libbe import cmdutil, bugdir, diff import os __desc__ = __doc__ -def execute(args, test=False): +def execute(args, manipulate_encodings=True): """ >>> import os >>> bd = bugdir.simple_bug_dir() @@ -31,7 +31,7 @@ def execute(args, test=False): >>> changed = bd.rcs.commit("Closed bug a") >>> os.chdir(bd.root) >>> if bd.rcs.versioned == True: - ... execute([original], test=True) + ... execute([original], manipulate_encodings=False) ... else: ... print "a:cm: Bug A\\nstatus: open -> closed\\n" Modified bug reports: @@ -48,7 +48,8 @@ def execute(args, test=False): revision = args[0] 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) if bd.rcs.versioned == False: print "This directory is not revision-controlled." else: -- cgit