monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] New 'update <rev>' command?


From: Nathaniel Smith
Subject: Re: [Monotone-devel] New 'update <rev>' command?
Date: Sun, 21 Nov 2004 19:07:29 -0800
User-agent: Mutt/1.5.6i

On Sun, Nov 21, 2004 at 06:22:32PM +0100, Joel Rosdahl wrote:
> Nathaniel Smith <address@hidden> writes:
> > I'm not sure I understand what's happening in your code, but it
> > doesn't look like it's doing that when a revision argument is
> > applied; is it actually doing like a merge-into-working directory or
> > something?
> 
> No. It's supposed to apply the changeset between the working copy's
> base revision B and the target revision R to the working copy, thereby
> moving the working copy's base revision to R while keeping local
> changes. To get the changeset between B and R, there are four cases:
[...]
> But I may very well have made some error. Is it something in
> particular that caught your eye?

Ah, perfect!  No, I was just confused, since I had a very different
(much more complicated) algorithm in mind for calculating changesets
in this case, and I didn't read your code carefully enough to realize
what you were doing.  Looking at it now, it makes perfect sense; you
were just too clever for me ;-).

It would probably be worthwhile at some point to implement what I was
thinking of, i.e. searching for an arbitrary path between the two
revisions and then tracing it to construct the changeset, since it
would be marginally more efficient (I think), and more importantly,
work even when there's no common ancestor.  But that's a corner case,
and both versions should give the same result the rest of the time, at
least assuming that Graydon's final implementation of changesets
has the same invariants we discussed when talking about the design...
guess he can tell me if I'm wrong here :-)

Amusingly, in thinking about this, I just realized that you've
gone and implemented the cherrypicking algorithm I was sort of vaguely
suggesting might exist; updating from OLD-BASE to NEW-BASE is exactly
the same as cherrypicking the OLD-BASE -> WORKING-DIR change onto
NEW-BASE...

(Is there a better name for cherrypicking here, to distinguish it from
the Arch-style history-preserving cherrypicking that people are
usually advertising when they talk about cherrypicking?)

-- Nathaniel

-- 
"...All of this suggests that if we wished to find a modern-day model
for British and American speech of the late eighteenth century, we could
probably do no better than Yosemite Sam."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]