[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:43:03 BST 2009


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

John Arbash Meinel wrote:
> 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()


so it seems I got a bit carried away, and did more cleanups than I
specifically expected. However, I'm pretty happy with the result. Are
you okay with it?

For what it is worth, I would probably agree that we probably should
default to the tree info, although giving a warning if out of sync might
be good, too.

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

iEYEARECAAYFAkopIOcACgkQJdeBCYSNAAMoMQCdHlLz2qhdZ2OINVgYIMxzPFHR
utQAn06qzKqoc0IPNm71m+iLOIIESBpz
=9NDz
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tree_opt.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20090605/43c9bc12/attachment-0001.diff 


More information about the bazaar mailing list