Rev 5627: (jelmer) Exit with 1 if there were tag conflicts during 'bzr pull'. (Jelmer in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Fri Jan 21 00:19:12 UTC 2011
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 5627 [merge]
revision-id: pqm at pqm.ubuntu.com-20110121001909-0t7a81zk94edbp0u
parent: pqm at pqm.ubuntu.com-20110119233608-9ubpvsukhoafgqs6
parent: jelmer at samba.org-20110120213526-osoqy34af81zex4e
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2011-01-21 00:19:09 +0000
message:
(jelmer) Exit with 1 if there were tag conflicts during 'bzr pull'. (Jelmer
Vernooij)
modified:
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/tests/blackbox/test_pull.py test_pull.py-20051201144907-64959364f629947f
bzrlib/tests/blackbox/test_tags.py test_tags.py-20070116132048-5h4qak2cm22jlb9e-1
doc/en/release-notes/bzr-2.4.txt bzr2.4.txt-20110114053217-k7ym9jfz243fddjm-1
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2011-01-19 18:40:15 +0000
+++ b/bzrlib/builtins.py 2011-01-20 19:59:11 +0000
@@ -1016,6 +1016,10 @@
log.show_branch_change(
branch_to, self.outf, result.old_revno,
result.old_revid)
+ if getattr(result, 'tag_conflicts', None):
+ return 1
+ else:
+ return 0
class cmd_push(Command):
=== modified file 'bzrlib/tests/blackbox/test_pull.py'
--- a/bzrlib/tests/blackbox/test_pull.py 2010-09-27 20:22:57 +0000
+++ b/bzrlib/tests/blackbox/test_pull.py 2011-01-18 23:28:48 +0000
@@ -142,7 +142,6 @@
self.run_bzr('pull -r 4')
self.assertEqual(a.revision_history(), b.revision_history())
-
def test_overwrite_uptodate(self):
# Make sure pull --overwrite overwrites
# even if the target branch has merged
@@ -495,4 +494,13 @@
self.assertEqual(out,
('','bzr: ERROR: Need working tree for --show-base.\n'))
-
+ def test_pull_tag_conflicts(self):
+ """pulling tags with conflicts will change the exit code"""
+ # create a branch, see that --show-base fails
+ from_tree = self.make_branch_and_tree('from')
+ from_tree.branch.tags.set_tag("mytag", "somerevid")
+ to_tree = self.make_branch_and_tree('to')
+ to_tree.branch.tags.set_tag("mytag", "anotherrevid")
+ out = self.run_bzr(['pull','-d','to','from'],retcode=1)
+ self.assertEqual(out,
+ ('No revisions to pull.\nConflicting tags:\n mytag\n', ''))
=== modified file 'bzrlib/tests/blackbox/test_tags.py'
--- a/bzrlib/tests/blackbox/test_tags.py 2011-01-12 01:01:53 +0000
+++ b/bzrlib/tests/blackbox/test_tags.py 2011-01-20 21:35:26 +0000
@@ -18,20 +18,15 @@
from bzrlib import (
branchbuilder,
- bzrdir,
tag,
)
from bzrlib.branch import (
Branch,
)
-from bzrlib.bzrdir import BzrDir
from bzrlib.tests import (
script,
TestCaseWithTransport,
)
-from bzrlib.repository import (
- Repository,
- )
from bzrlib.workingtree import WorkingTree
@@ -333,7 +328,8 @@
self.assertContainsRe(out,
'Conflicting tags:\n.*' + tagname.encode('utf-8'))
# pull should give a warning about the tags
- out, err = self.run_bzr('pull -d one two', encoding='utf-8')
+ out, err = self.run_bzr('pull -d one two', encoding='utf-8',
+ retcode=1)
self.assertContainsRe(out,
'Conflicting tags:\n.*' + tagname.encode('utf-8'))
# merge should give a warning about the tags -- not implemented yet
=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt 2011-01-19 18:18:48 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt 2011-01-20 19:59:11 +0000
@@ -40,9 +40,6 @@
* ``bzr push --overwrite`` with an older revision specified will now correctly
roll back the target branch. (Jelmer Vernooij, #386576)
-* ``bzr serve`` no longer crashes when a server_started hook is installed and IPv6
- support is available on the system. (Jelmer Vernooij, #293697)
-
* ``bzr lp-propose`` can now propose merges against packaging branches on
Launhcpad without requiring the target branch to be specified. (Jelmer Vernooij,
#704647)
@@ -51,6 +48,12 @@
leave setting the reviewer up to Launchpad if it was not specified.
(Jelmer Vernooij, #583772)
+* ``bzr pull`` will now exit with exit code 1 if there were tag conflicts.
+ (Jelmer Vernooij, #213185)
+
+* ``bzr serve`` no longer crashes when a server_started hook is installed and IPv6
+ support is available on the system. (Jelmer Vernooij, #293697)
+
* ``bzr whoami`` will now display an error if both a new identity and ``--email``
were specified. (Jelmer Vernooij, #680449)
More information about the bazaar-commits
mailing list