aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/storage/vcs
diff options
context:
space:
mode:
Diffstat (limited to 'libbe/storage/vcs')
-rw-r--r--libbe/storage/vcs/__init__.py2
-rw-r--r--libbe/storage/vcs/arch.py2
-rw-r--r--libbe/storage/vcs/base.py2
-rw-r--r--libbe/storage/vcs/bzr.py12
-rw-r--r--libbe/storage/vcs/darcs.py7
-rw-r--r--libbe/storage/vcs/git.py2
-rw-r--r--libbe/storage/vcs/hg.py3
-rw-r--r--libbe/storage/vcs/monotone.py2
8 files changed, 22 insertions, 10 deletions
diff --git a/libbe/storage/vcs/__init__.py b/libbe/storage/vcs/__init__.py
index 49b0ce3..47d92db 100644
--- a/libbe/storage/vcs/__init__.py
+++ b/libbe/storage/vcs/__init__.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2010 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2009-2011 W. Trevor King <wking@drexel.edu>
#
# This file is part of Bugs Everywhere.
#
diff --git a/libbe/storage/vcs/arch.py b/libbe/storage/vcs/arch.py
index 129e198..d12a91a 100644
--- a/libbe/storage/vcs/arch.py
+++ b/libbe/storage/vcs/arch.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2010 Aaron Bentley <abentley@panoramicfeedback.com>
+# Copyright (C) 2005-2011 Aaron Bentley <abentley@panoramicfeedback.com>
# Ben Finney <benf@cybersource.com.au>
# Gianluca Montecchi <gian@grys.it>
# James Rowe <jnrowe@ukfsn.org>
diff --git a/libbe/storage/vcs/base.py b/libbe/storage/vcs/base.py
index 11ce754..570af17 100644
--- a/libbe/storage/vcs/base.py
+++ b/libbe/storage/vcs/base.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2010 Aaron Bentley <abentley@panoramicfeedback.com>
+# Copyright (C) 2005-2011 Aaron Bentley <abentley@panoramicfeedback.com>
# Alexander Belchenko <bialix@ukr.net>
# Ben Finney <benf@cybersource.com.au>
# Chris Ball <cjb@laptop.org>
diff --git a/libbe/storage/vcs/bzr.py b/libbe/storage/vcs/bzr.py
index 616a486..1862975 100644
--- a/libbe/storage/vcs/bzr.py
+++ b/libbe/storage/vcs/bzr.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2010 Aaron Bentley <abentley@panoramicfeedback.com>
+# Copyright (C) 2005-2011 Aaron Bentley <abentley@panoramicfeedback.com>
# Ben Finney <benf@cybersource.com.au>
# Gianluca Montecchi <gian@grys.it>
# Marien Zwart <marien.zwart@gmail.com>
@@ -136,12 +136,14 @@ class Bzr(base.VCS):
cmd = bzrlib.builtins.cmd_root()
cmd.outf = StringIO.StringIO()
cmd.run(filename=path)
+ cmd.cleanup_now()
return cmd.outf.getvalue().rstrip('\n')
def _vcs_init(self, path):
cmd = bzrlib.builtins.cmd_init()
cmd.outf = StringIO.StringIO()
cmd.run(location=path)
+ cmd.cleanup_now()
def _vcs_destroy(self):
vcs_dir = os.path.join(self.repo, '.bzr')
@@ -153,6 +155,7 @@ class Bzr(base.VCS):
cmd = bzrlib.builtins.cmd_add()
cmd.outf = StringIO.StringIO()
cmd.run(file_list=[path], file_ids_from=self.repo)
+ cmd.cleanup_now()
def _vcs_exists(self, path, revision=None):
manifest = self._vcs_listdir(
@@ -167,6 +170,7 @@ class Bzr(base.VCS):
cmd = bzrlib.builtins.cmd_remove()
cmd.outf = StringIO.StringIO()
cmd.run(file_list=[path], file_deletion_strategy='force')
+ cmd.cleanup_now()
def _vcs_update(self, path):
pass
@@ -202,6 +206,7 @@ class Bzr(base.VCS):
if self.version_cmp(2,0,0) < 0:
cmd.outf = sys.stdout
sys.stdout = stdout
+ cmd.cleanup_now()
return cmd.outf.getvalue()
def _vcs_path(self, id, revision):
@@ -236,6 +241,8 @@ class Bzr(base.VCS):
if 'not present in revision' in str(e):
raise base.InvalidPath(path, root=self.repo, revision=revision)
raise
+ finally:
+ cmd.cleanup_now()
children = cmd.outf.getvalue().rstrip('\n').splitlines()
children = [self._u_rel_path(c, path) for c in children]
if self.version_cmp(2,0,0) < 0 and recursive == False:
@@ -257,12 +264,14 @@ class Bzr(base.VCS):
raise
finally:
os.chdir(cwd)
+ cmd.cleanup_now()
return self._vcs_revision_id(-1)
def _vcs_revision_id(self, index):
cmd = bzrlib.builtins.cmd_revno()
cmd.outf = StringIO.StringIO()
cmd.run(location=self.repo)
+ cmd.cleanup_now()
current_revision = int(cmd.outf.getvalue())
if index > current_revision or index < -current_revision:
return None
@@ -281,6 +290,7 @@ class Bzr(base.VCS):
status = cmd.run(revision=revision, file_list=[self.repo])
finally:
sys.stdout = stdout
+ cmd.cleanup_now()
assert status in [0,1], "Invalid status %d" % status
return cmd.outf.getvalue()
diff --git a/libbe/storage/vcs/darcs.py b/libbe/storage/vcs/darcs.py
index 7ff4554..4aa8766 100644
--- a/libbe/storage/vcs/darcs.py
+++ b/libbe/storage/vcs/darcs.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2010 Gianluca Montecchi <gian@grys.it>
+# Copyright (C) 2009-2011 Gianluca Montecchi <gian@grys.it>
# W. Trevor King <wking@drexel.edu>
#
# This file is part of Bugs Everywhere.
@@ -229,8 +229,9 @@ class Darcs(base.VCS):
descendents = [self._u_rel_path(f, path) for f in files
if f != '.']
else:
- descendents = [self._u_rel_path(f, path) for f in files
- if f.startswith(path)]
+ rel_files = [self._u_rel_path(f, path) for f in files]
+ descendents = [f for f in rel_files
+ if f != '.' and not f.startswith('..')]
return [f for f in descendents if f.count(os.path.sep) == 0]
# Darcs versions <= 2.3.1 lack the --patch option for 'show files'
raise NotImplementedError
diff --git a/libbe/storage/vcs/git.py b/libbe/storage/vcs/git.py
index c9f10fe..7c9199d 100644
--- a/libbe/storage/vcs/git.py
+++ b/libbe/storage/vcs/git.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2010 Ben Finney <benf@cybersource.com.au>
+# Copyright (C) 2008-2011 Ben Finney <benf@cybersource.com.au>
# Chris Ball <cjb@laptop.org>
# Gianluca Montecchi <gian@grys.it>
# W. Trevor King <wking@drexel.edu>
diff --git a/libbe/storage/vcs/hg.py b/libbe/storage/vcs/hg.py
index 7e2fa86..d610352 100644
--- a/libbe/storage/vcs/hg.py
+++ b/libbe/storage/vcs/hg.py
@@ -1,6 +1,7 @@
-# Copyright (C) 2007-2010 Aaron Bentley <abentley@panoramicfeedback.com>
+# Copyright (C) 2005-2011 Aaron Bentley <abentley@panoramicfeedback.com>
# Ben Finney <benf@cybersource.com.au>
# Gianluca Montecchi <gian@grys.it>
+# Marien Zwart <marien.zwart@gmail.com>
# W. Trevor King <wking@drexel.edu>
#
# This file is part of Bugs Everywhere.
diff --git a/libbe/storage/vcs/monotone.py b/libbe/storage/vcs/monotone.py
index 1e15aa4..65ecd91 100644
--- a/libbe/storage/vcs/monotone.py
+++ b/libbe/storage/vcs/monotone.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2010-2011 W. Trevor King <wking@drexel.edu>
#
# This file is part of Bugs Everywhere.
#