[issue2071] merge fails with "untracked file in working directory" even when the merge would not affect that file

Greg Ward bugs at mercurial.selenic.com
Thu Mar 4 16:40:51 UTC 2010


New submission from Greg Ward <greg-hg at gerg.ca>:

"hg merge" is a little too eager to fail with "untracked file in working
directory differs from file in requested revision".  In particular, it will
trigger this error even if none of the changesets being merged affect the
untracked file.

Here's a simple reproduction script:

hg init test
cd test
touch foo bar
hg commit -A -m "init"
hg branch 1.0
echo 1 > foo
hg ci -m "mod foo"
hg up default
hg rm bar
hg ci -m "rm bar"
echo 1 > bar
hg status            # "? bar"
hg merge 1.0         # fails because of bar

But it's clear that the merged changeset does not affect bar:

$ hg merge -P -v 1.0
changeset:   1:558fbb36ce36
branch:      1.0
user:        [...]
date:        2010-03-04 11:35:27 -0500
files:
  M foo
description:
mod foo

So really, merge should not care about the untracked bar in the local
directory.  It's not relevant.

The workaround is easy, of course: delete or remove bar before merging. 
Still, it's annoying and confusing.

----------
messages: 11932
nosy: gward
priority: bug
status: unread
title: merge fails with "untracked file in working directory" even when the merge would not affect that file

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2071>
____________________________________________________


More information about the Mercurial-devel mailing list