[MERGE] Let revno and revision-info tell me about the tree as well as the branch

John Arbash Meinel john at arbash-meinel.com
Fri Jun 5 14:16:23 BST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Matthew D. Fuller wrote:
>> This may not be excessively clean, but it works.
> 
> This is slightly cleaner, since it gives the right answer for revno if
> you're off the mainline, and a less ugly answer if you're off the
> branch totally.

This might give the wrong thing for a lightweight checkout. I'm not
positive the behavior of 'Branch.open_containing()' in those circumstances.

However, I would recommend:

if tree:
  wt = WorkingTree.open_containing(location)[0]
  branch = bt.branch
  revid = ...
else:
  branch = Branch.open_containing()
  revno = branch.revno()


For the tests,

+        # Make checkout and move the branch forward
+        self.run_bzr('checkout --lightweight branch checkout')
+        wt.commit('Commit two', rev_id='a at r-0-2')

we should be using wt.branch.create_checkout...

I'll put together the tweaks and you can see what you think.

BB:tweak

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkopGqcACgkQJdeBCYSNAAPNyACgxpUvPyWOT3w1tMjaT4PqtkGh
BVgAn1BIfYZ+CkzdhOwv2V367zx5r/ri
=lqk4
-----END PGP SIGNATURE-----



More information about the bazaar mailing list