[MERGE] loosen the constraints on WorkingTree.set_last_revision.
Robert Collins
robertc at robertcollins.net
Mon Aug 7 22:58:35 BST 2006
On Mon, 2006-08-07 at 10:40 -0500, John Arbash Meinel wrote:
> Robert Collins wrote:
> > WorkingTree.set_last_revision currently requires the revision be in the
> > branch's history. However, using uncommit one can easily have a tree
> > whose branch does not contain the tree's last revision - it makes sense
> > to me to allow constructing that scenario directly via the api.
> >
> > This is useful to allow simplifying some of the corner cases in
> > baz-import, and for dirstate.
> >
> > Seeking a +1.
> >
> > Rob
...
> I believe this section is for format 2 working trees (all-in-one).
> I like the first part (setting the last_revision outside the history
> regenerates the ancestry)
> I'm not so sure about the utility of being able to set the revision
> history when you don't have a history.
>
> This seems much more like an error, since you can't do any state
> comparisons, etc.
>
> So for me, +1 on 'generate_revision_history', -1 on swallowing
> NoSuchRevision.
...
> Here I would rather check that we have the revision in the repository,
> for the same reason as above.
> I suppose it isn't critical, but I would at least want a good
> explanation as to why we should allow the api to set a last revision
> that we don't have access to. (Better to find someone else's bug by
> raising an exception than to just make it easier to run a test case)
Heres the dirty little secret from baz-import. When it imports something
whose origin history is not available, it does (roughly)
t = init
t.set_pending_merges([inaccessible_first_parent])
t.set_inventory()
t.commit()
And *due to a bug in commit* this gets recorded in such a way that
loading the revision back from disk gives [inaccessible_first_parent] as
the list of parent_ids.
IOW, the first_parent of the working tree was in fact an inaccessible
ghost revision.
I want to clean this up on the way through to dirstate, preserving its
quirky behaviour would make my code harder to write.
Cleaning it up means making the last_revision able to be a ghost for all
trees.
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060808/73cef064/attachment.pgp
More information about the bazaar
mailing list