diff options
author | W. Trevor King <wking@drexel.edu> | 2008-11-22 16:15:16 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2008-11-22 16:15:16 -0500 |
commit | 6d4785e75e1552b3f04b1499fede6fdef2732c39 (patch) | |
tree | 7fda56847fe1d7515cac381b6ed414b4afe5a1c9 /libbe/rcs.py | |
parent | 93801606303d79cfe9c1483cd6627cb1b93dedc7 (diff) | |
download | bugseverywhere-6d4785e75e1552b3f04b1499fede6fdef2732c39.tar.gz |
Created and fixed bug 496edad5-1484-413a-bc68-4b01274a65eb.
I figured out why Arch was complaining. For non-Arch users, file
system access has been tweaked a bit see the BugDir doc string for
details. Also, you should now set BugDir.rcs instead of .rcs_name.
.rcs_name automatically tracks changes in .rcs (the reverse of the
previous situation), so read from whichever you like.
Diffstat (limited to 'libbe/rcs.py')
-rw-r--r-- | libbe/rcs.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libbe/rcs.py b/libbe/rcs.py index abd92cb..10338b9 100644 --- a/libbe/rcs.py +++ b/libbe/rcs.py @@ -24,15 +24,18 @@ import tempfile import shutil import unittest import doctest + + from utility import Dir, search_parent_directories + def _get_matching_rcs(matchfn): """Return the first module for which matchfn(RCS_instance) is true""" import arch import bzr import hg import git - for module in [git, arch, bzr, hg, git]: + for module in [arch, bzr, hg, git]: rcs = module.new() if matchfn(rcs) == True: return rcs @@ -70,7 +73,7 @@ def new(): class RCS(object): """ - Implement the 'no-rcs' interface. + This class implements a 'no-rcs' interface. Support for other RCSs can be added by subclassing this class, and overriding methods _rcs_*() with code appropriate for your RCS. @@ -340,9 +343,9 @@ class RCS(object): def _u_invoke(self, args, expect=(0,), cwd=None): if cwd == None: cwd = self.rootdir + if self.verboseInvoke == True: + print >> sys.stderr, "%s$ %s" % (cwd, " ".join(args)) try : - if self.verboseInvoke == True: - print "%s$ %s" % (cwd, " ".join(args)) if sys.platform != "win32": q = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE, cwd=cwd) else: @@ -354,8 +357,11 @@ class RCS(object): raise CommandError(strerror, e.args[0]) output, error = q.communicate() status = q.wait() + if self.verboseInvoke == True: + print >> sys.stderr, "%d\n%s%s" % (status, output, error) if status not in expect: - raise CommandError(error, status) + strerror = "%s\nwhile executing %s\n%s" % (args[1], args, error) + raise CommandError(strerror, status) return status, output, error def _u_invoke_client(self, *args, **kwargs): directory = kwargs.get('directory',None) |