Question about internal:fail

Mike Meyer mwm at mired.org
Thu Dec 1 19:45:45 UTC 2011


On Thu, 1 Dec 2011 20:00:56 +0100
Dennis Brakhane <brakhane at googlemail.com> wrote:

> On Thu, Dec 1, 2011 at 3:23 AM, Mike Meyer <mwm at mired.org> wrote:
> > That's not what I want. What I *really* want is a way to use
> > resolves machinery on every file that differs between the two
> > branches. The original idea was to use internal:fail to start
> > that. That was when I discovered that it wasn't called under
> > conditions when I thought it should be. That's why the subject line
> > is about internal:fail.
> 
> Let's review your example:
> 
> fedora% sh -v testcase
> hg init x
> cd x
> echo "Testing" > foo
> hg add foo
> hg ci -m "Initial version"
> echo hello >> foo
> hg ci -m "Branch 1"
> hg up 0
> 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> cp foo foo2
> hg add foo2
> hg ci -m "Branch 2"
> created new head
> hg up 1
> 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
> hg merge --tool internal:fail
> 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> (branch merge, don't forget to commit)
> 
> 
> There are really no files that differ, foo2 is a new file to
> hg.

foo2 isn't the issue. foo is the issue. On the Branch 1, it's:

    Testing
    hello

On Branch 2, foo is still just:

    Testing

That sure looks like a file that differs to me! And that's the one I
want to get to with the resolve machinery.

> It doesn't know that [foo2] is a copy of foo.

I don't really care about foo2. The example has to include two files,
as it's about changing a file on just one branch, which means a second
file has to be changed to get the second branch.  Adding a file is the
easy way to do that. Ok, maybe I ought to care about foo2, but
existence or non-existence is a simple enough issue that I don't.

Let's try a different example for the second change that shows why I
want this:


$ hg init x
$ cd x
$ echo bar1 > foo1
$ echo bar2 > foo2
$ cat *
bar1
bar2
$ hg add *
$ hg ci -m "Base version."
$ echo hello >> foo1
$ hg ci -m "Branch 1"
$ hg up 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo hello >> foo2
$ hg ci -m "Branch 2"
created new head
$ hg merge --tool internal:fail
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ cat *
bar1
hello
bar2
hello

I needed to add "hello". It got added to different files on the two
branches. So both files differ between the branches, I can't use
resolve on either one, and it only told me about one of them changing!
I have to find the other one by hand.

     <mike



More information about the Mercurial mailing list