# HG changeset patch # User Patrick Mezard # Date 2012-04-23 12:32:59 # Node ID 774e2dcd0a65129f23260c0eae4a855b6bb7ed12 # Parent bfe89d65d651c9b83a15164e36c738c613b12666 update: fix case-collision with a clean wd and no --clean cbf2ea2f5ca1 introduced some logic to avoid case-collision detection between source and destination revisions when it does not make sense: clean or to be cleaned working directories. Unfortunately, part of it was flawed and the related test was broken by another bug. This patch disables cross revision case collision detection for updates without option or with --check, if the working directory is clean. diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -577,7 +577,8 @@ def update(repo, node, branchmerge, forc folding = not util.checkcase(repo.path) if folding: # collision check is not needed for clean update - if not branchmerge and force: + if (not branchmerge and + (force or not wc.dirty(missing=True, branch=False))): _checkcollision(p2, None) else: _checkcollision(p2, wc) diff --git a/tests/test-casecollision-merge.t b/tests/test-casecollision-merge.t --- a/tests/test-casecollision-merge.t +++ b/tests/test-casecollision-merge.t @@ -143,14 +143,14 @@ test for rename awareness of case-foldin $ hg commit -m '#2' $ hg update 0 - abort: case-folding collision between a and A - [255] + 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg parents --template '{rev}\n' - 2 + 0 $ hg status -A - C A + C a $ cat A - A + a + $ hg up -qC 2 $ hg update --check 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved