Rev 6521: (jelmer) Add tag information to the output of bzr missing. (Neil in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
Patch Queue Manager
pqm at pqm.ubuntu.com
Mon Apr 16 10:30:50 UTC 2012
At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 6521 [merge]
revision-id: pqm at pqm.ubuntu.com-20120416103050-rbkgxv7kih8y80ca
parent: pqm at pqm.ubuntu.com-20120410102646-rv7zpi85e168o1k4
parent: nmb at wartburg.edu-20120416020046-ech9tsnnrrplxoc4
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2012-04-16 10:30:50 +0000
message:
(jelmer) Add tag information to the output of bzr missing. (Neil
Martinsen-Burrell)
modified:
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/missing.py missing.py-20050812153334-097f7097e2a8bcd1
bzrlib/tests/blackbox/test_missing.py test_missing.py-20051211212735-a2cf4c1840bb84c4
doc/en/release-notes/bzr-2.6.txt bzr2.6.txt-20120116134316-8w1xxom1c7vcu1t5-1
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2012-03-25 13:36:53 +0000
+++ b/bzrlib/builtins.py 2012-04-11 02:22:42 +0000
@@ -5002,9 +5002,13 @@
"You have %d extra revisions:\n",
len(local_extra)) %
len(local_extra))
+ rev_tag_dict = {}
+ if local_branch.supports_tags():
+ rev_tag_dict = local_branch.tags.get_reverse_tag_dict()
for revision in iter_log_revisions(local_extra,
local_branch.repository,
- verbose):
+ verbose,
+ rev_tag_dict):
lf.log_revision(revision)
printed_local = True
status_code = 1
@@ -5018,9 +5022,12 @@
"You are missing %d revisions:\n",
len(remote_extra)) %
len(remote_extra))
+ if remote_branch.supports_tags():
+ rev_tag_dict = remote_branch.tags.get_reverse_tag_dict()
for revision in iter_log_revisions(remote_extra,
remote_branch.repository,
- verbose):
+ verbose,
+ rev_tag_dict):
lf.log_revision(revision)
status_code = 1
=== modified file 'bzrlib/missing.py'
--- a/bzrlib/missing.py 2011-12-19 13:23:58 +0000
+++ b/bzrlib/missing.py 2012-04-11 02:22:42 +0000
@@ -25,9 +25,12 @@
import bzrlib.revision as _mod_revision
-def iter_log_revisions(revisions, revision_source, verbose):
+def iter_log_revisions(revisions, revision_source, verbose, rev_tag_dict=None):
last_tree = revision_source.revision_tree(_mod_revision.NULL_REVISION)
last_rev_id = None
+
+ if rev_tag_dict is None:
+ rev_tag_dict = {}
for rev in revisions:
# We need the following for backward compatibilty (hopefully
# this will be deprecated soon :-/) -- vila 080911
@@ -41,7 +44,8 @@
delta = revision_source.get_revision_delta(rev_id)
else:
delta = None
- yield log.LogRevision(rev, revno, merge_depth, delta=delta)
+ yield log.LogRevision(rev, revno, merge_depth, delta=delta,
+ tags=rev_tag_dict.get(rev_id))
def find_unmerged(local_branch, remote_branch, restrict='all',
=== modified file 'bzrlib/tests/blackbox/test_missing.py'
--- a/bzrlib/tests/blackbox/test_missing.py 2012-01-05 13:02:31 +0000
+++ b/bzrlib/tests/blackbox/test_missing.py 2012-04-11 02:22:42 +0000
@@ -234,3 +234,29 @@
out1, err1 = self.run_bzr('missing ../b', retcode=1, working_dir='a')
self.assertEqualDiff(out1, out2)
self.assertEqualDiff(err1, err2)
+
+ def test_missing_tags(self):
+ """Test showing tags"""
+
+ # create a source branch
+ a_tree = self.make_branch_and_tree('a')
+ self.build_tree_contents([('a/a', 'initial\n')])
+ a_tree.add('a')
+ a_tree.commit(message='initial')
+
+ # clone and add a differing revision
+ b_tree = a_tree.bzrdir.sprout('b').open_workingtree()
+ self.build_tree_contents([('b/a', 'initial\nmore\n')])
+ b_tree.commit(message='more')
+ b_tree.branch.tags.set_tag('a-tag', b_tree.last_revision())
+
+ for log_format in ['long', 'short', 'line']:
+ out, err = self.run_bzr(
+ 'missing --log-format={0} ../a'.format(log_format),
+ working_dir='b', retcode=1)
+ self.assertContainsString(out, 'a-tag')
+
+ out, err = self.run_bzr(
+ 'missing --log-format={0} ../b'.format(log_format),
+ working_dir='a', retcode=1)
+ self.assertContainsString(out, 'a-tag')
=== modified file 'doc/en/release-notes/bzr-2.6.txt'
--- a/doc/en/release-notes/bzr-2.6.txt 2012-04-06 11:38:05 +0000
+++ b/doc/en/release-notes/bzr-2.6.txt 2012-04-16 02:00:46 +0000
@@ -35,6 +35,9 @@
.. Fixes for situations where bzr would previously crash or give incorrect
or undesirable results.
+* "bzr missing" now shows tag names when displaying revision information.
+ (#559072, Neil Martinsen-Burrell)
+
* Implement ``ResponseFile.readline`` and ``ReponseFile.tell``,
fixing some clones over HTTP. (Jelmer Vernooij, #963769)
More information about the bazaar-commits
mailing list