Rev 3002: (John Arbash Meinel) Fix 'bzr uncommit' in a branch with no history. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Fri Nov 16 04:45:32 GMT 2007
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 3002
revision-id: pqm at pqm.ubuntu.com-20071116044522-3q7b9a1nt4nl5lfy
parent: pqm at pqm.ubuntu.com-20071116032244-6vp47pvjovt9anps
parent: john at arbash-meinel.com-20071116021134-e0fjjpjllimkhj3v
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2007-11-16 04:45:22 +0000
message:
(John Arbash Meinel) Fix 'bzr uncommit' in a branch with no history.
modified:
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/tests/blackbox/test_uncommit.py test_uncommit.py-20051027212835-84944b63adae51be
------------------------------------------------------------
revno: 2948.2.2
merged: john at arbash-meinel.com-20071116021134-e0fjjpjllimkhj3v
parent: john at arbash-meinel.com-20071101195357-0wal0m1h8822rzik
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: uncommit_no_history
timestamp: Thu 2007-11-15 20:11:34 -0600
message:
Re-introduce the None check in case someone asks to uncommit *to* the last revision
------------------------------------------------------------
revno: 2948.2.1
merged: john at arbash-meinel.com-20071101195357-0wal0m1h8822rzik
parent: pqm at pqm.ubuntu.com-20071029050400-j2jmz8smj2yecfrr
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: uncommit_no_history
timestamp: Thu 2007-11-01 14:53:57 -0500
message:
Fix 'bzr uncommit' when there is no revision history.
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2007-11-06 11:11:18 +0000
+++ b/bzrlib/builtins.py 2007-11-16 04:45:22 +0000
@@ -3556,7 +3556,7 @@
if revno <= b.revno():
rev_id = b.get_rev_id(revno)
- if rev_id is None:
+ if rev_id is None or _mod_revision.is_null(rev_id):
self.outf.write('No revisions to uncommit.\n')
return 1
=== modified file 'bzrlib/tests/blackbox/test_uncommit.py'
--- a/bzrlib/tests/blackbox/test_uncommit.py 2007-06-26 20:32:49 +0000
+++ b/bzrlib/tests/blackbox/test_uncommit.py 2007-11-01 19:53:57 +0000
@@ -60,6 +60,12 @@
out, err = self.run_bzr('status')
self.assertEquals(out, 'modified:\n a\n')
+ def test_uncommit_no_history(self):
+ wt = self.make_branch_and_tree('tree')
+ out, err = self.run_bzr('uncommit --force', retcode=1)
+ self.assertEqual('', err)
+ self.assertEqual('No revisions to uncommit.\n', out)
+
def test_uncommit_checkout(self):
wt = self.create_simple_tree()
checkout_tree = wt.branch.create_checkout('checkout')
More information about the bazaar-commits
mailing list