[RFC] CURRENT_TREE_REVISION ?
Aaron Bentley
aaron.bentley at utoronto.ca
Fri Jun 16 14:00:16 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robert Collins wrote:
> I'm thinking of adding a new special revision marker, like null: is
> today, which will be current:.
>
> add_revision and get_revision will guard against this being
> stored/retrieved.
>
> It will be the revision id for the working tree.
I've thought about doing the same thing for quite a while. It feels
somewhat icky to have a revision-id for something that's not a revision
(yet), but it solves a bunch of problems, so I'm +1 overall.
I'm not sure current: is the clearest thing-- I immediately thought it
meant WorkingTree.last_revision(). Maybe 'directory:'?
> This allows the following things without [much?|any?] special casing:
>
> * bzr log can show the pending merges as being merged into the current
> tree.
(some formatting issues, though. Log output is designed so the merging
revision comes first.)
> Possibly there are other applications for it.
Bzr revert and shelve can use it to create bundles for the working tree
instead of backup files or patches.
"bzr merge -r -1..revid:current: foo" can be used can be used to copy
uncommitted changes from foo. (See also bzrtools shove, though.)
> I'm thinking of an api like 'tree.get_revision()' to get the revision
> object that owns a tree. For EmptyTree this is a Revision object
> representing 'null:', for WorkingTree this is a Revision object
> representing 'current:' with parents matching the parents list of the
> tree - i.e. null: for a newly inited tree.
RevisionTrees already have a revision_id member, so we chould just
provide that to the others.
One downside to this idea is that the 'current:' revision id doesn't
have a fixed meaning, and two trees with that revision id may not refer
to the same thing.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFEkqtg0F+nu1YWqI0RAv5tAJ9bWV9xN0Ur0UeD42GeRCCJjzq05ACfbHsH
0xxfy9w4VhniQw5VG18lJXw=
=1Qc8
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list