aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2011-01-08 20:39:48 -0500
committerChris Ball <cjb@laptop.org>2011-01-08 20:39:48 -0500
commit81373db51acdd5639500569668c9333bf1f098cd (patch)
treeb8ce0c38b7dc7af589c6ce32b73ef90eab5f7869
parent66037fb14b06ab42eb37e6cc93d10c9717ce0d9e (diff)
parent49896ffd2bf821150cfdfcc2a0e8c26c1fb2defe (diff)
downloadbugseverywhere-81373db51acdd5639500569668c9333bf1f098cd.tar.gz
Merge branch 'master' of http://www.physics.drexel.edu/~wking/code/git/be
-rw-r--r--doc/tutorial.txt13
-rw-r--r--libbe/command/show.py9
-rw-r--r--libbe/storage/vcs/bzr.py10
-rw-r--r--libbe/storage/vcs/darcs.py5
-rwxr-xr-xrelease.py10
5 files changed, 33 insertions, 14 deletions
diff --git a/doc/tutorial.txt b/doc/tutorial.txt
index 0154f5b..7b7220f 100644
--- a/doc/tutorial.txt
+++ b/doc/tutorial.txt
@@ -15,13 +15,12 @@ and helps keep the bug repository in sync with the code.
However, there are some differences compared to centralized
bugtrackers. Because bugs and comments can be created by several
-users in parallel, they have globally unique
-:mod:`IDs </libbe.util.id>` rather than numbers. There is also a
+users in parallel, they have globally unique :mod:`IDs
+</libbe.util.id>` rather than numbers. There is also a
developer-friendly command-line_ interface to compliment the
-user-friendly :doc:`web </tutorial-html>` and
-:doc:`email </tutorial-email>` interfaces. This tutorial will focus
-on the command-line interface as the most powerful, and leave the web
-and email interfaces to other documents.
+user-friendly :doc:`web </http>` and :doc:`email </email>` interfaces.
+This tutorial will focus on the command-line interface as the most
+powerful, and leave the web and email interfaces to other documents.
.. _command-line: `Command-line interface`_
@@ -358,7 +357,7 @@ To create a static dump of your bug directory, use::
This is a fairly flexible command, see ``be help html`` for details.
It works pretty well as the browsable part of a public interface using
-the email_ interface for interactive access.
+the :doc:`email` for interactive access.
BE over HTTP
------------
diff --git a/libbe/command/show.py b/libbe/command/show.py
index 27be07c..b24aa94 100644
--- a/libbe/command/show.py
+++ b/libbe/command/show.py
@@ -58,9 +58,9 @@ class Show (libbe.command.Command):
<be-xml>
<version>
<tag>...</tag>
- <branch-nick>...</branch-nick>
- <revno>...</revno>
- <revision-id>...</revision-id>
+ <committer>...</committer>
+ <date>...</date>
+ <revision>...</revision>
</version>
<bug>
<uuid>a</uuid>
@@ -156,8 +156,7 @@ def _xml_header(encoding):
'<be-xml>',
' <version>',
' <tag>%s</tag>' % libbe.version.version()]
- for tag in ['branch-nick', 'revno', 'revision-id']:
- value = libbe.version.version_info[tag.replace('-', '_')]
+ for tag,value in sorted(libbe.version.version_info.items()):
lines.append(' <%s>%s</%s>' % (tag, value, tag))
lines.append(' </version>')
return lines
diff --git a/libbe/storage/vcs/bzr.py b/libbe/storage/vcs/bzr.py
index 616a486..583a8f6 100644
--- a/libbe/storage/vcs/bzr.py
+++ b/libbe/storage/vcs/bzr.py
@@ -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..29b25eb 100644
--- a/libbe/storage/vcs/darcs.py
+++ b/libbe/storage/vcs/darcs.py
@@ -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/release.py b/release.py
index 23ac476..572df5a 100755
--- a/release.py
+++ b/release.py
@@ -119,6 +119,11 @@ def set_vcs_name(be_dir, vcs_name='None'):
invoke(['sed', '-i', "s/^vcs_name:.*/vcs_name: %s/" % vcs_name,
filename])
+def make_id_cache():
+ """Generate .be/id-cache so users won't need to.
+ """
+ invoke(['./be', 'list'])
+
def create_tarball(tag):
release_name='be-%s' % tag
export_dir = release_name
@@ -130,7 +135,12 @@ def create_tarball(tag):
shutil.copy(os.path.join('libbe', '_version.py'),
os.path.join(export_dir, 'libbe', '_version.py'))
make_changelog(os.path.join(export_dir, 'ChangeLog'), tag)
+ make_id_cache()
+ print 'copy .be/id-cache to %s/.be/id-cache' % export_dir
+ shutil.copy(os.path.join('.be', 'id-cache'),
+ os.path.join(export_dir, '.be', 'id-cache'))
set_vcs_name(os.path.join(export_dir, '.be'))
+ os.remove(os.path.join(export_dir, 'update_copyright.py'))
tarball_file = '%s.tar.gz' % release_name
print 'create tarball', tarball_file
invoke(['tar', '-czf', tarball_file, export_dir])