[PATCH] graft: print a message when nothing was grafted (issue3091)

Stefano Tortarolo stefano.tortarolo at gmail.com
Sat Nov 12 05:02:13 CST 2011


2011/11/8 Matt Mackall <mpm at selenic.com>

> On Tue, 2011-11-08 at 21:45 +0100, Stefano Tortarolo wrote:
> > # HG changeset patch
> > # User Stefano Tortarolo <stefano.tortarolo at gmail.com>
> > # Date 1320785084 -3600
> > # Node ID cd713156b2bf17cb9085d7bf295e3c8e3b39c75f
> > # Parent  de7e2fba4326cad80bda0cb100d2ae2f58e67ee8
> > graft: print a message when nothing was grafted (issue3091)
>
> This is probably the wrong solution.
>
>
Yes you're right. I'll resend another patch later.


A closely related question is what 'source' to set for a graft of a
> graft. We should probably copy the original source.
>
>
Uhm... I guess you're right.
Let's say we graft:

C -> C' -> C''

Note: for a better readability C' and C'' are later referred to as C1 and C2

Rev  | Source
 C   |
 C1  |  C
 C2  |  C

a. Graft C1 onto C => disallowed because source(C1) == C
b. Graft C2 onto C => disallowed because source(C2) == C
c. Graft C1 onto C2 => disallowed because C1's source == C2's source
d. Graft C2 onto C1 => disallowed because C2's source == C1's source
It's also quite easy to implement: we compare a cset's source with target
and target's source

What would happen if we used the newest cset as source?
Rev  | Source
 C   |
 C1  |  C
 C2  |  C1

a. Graft C1 onto C => disallowed because source(C1) == C
b. Graft C2 onto C => disallowed because source(C2) == C1 and source(C1) ==
C
c. Graft C1 onto C2 => disallowed because C2's source == C1
d. Graft C2 onto C1 => disallowed because C2's source == C1

There are a couple of drawbacks here:
1. in case b. we might need to traverse serveral nodes
2. we need to compare also cset with target's source in order to cover case
c.

Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20111112/1ffc3b58/attachment.html>


More information about the Mercurial-devel mailing list