Patchwork [6,of,7,STABLE] largefiles: check unknown files with case awareness of the filesystem

login
register
mail settings
Submitter Katsunori FUJIWARA
Date May 6, 2013, 8:35 p.m.
Message ID <f6c324c8d745ac8efe0e.1367872506@juju>
Download mbox | patch
Permalink /patch/1569/
State Accepted, archived
Commit 24877c50aadacd6ec1909d44b03c6f4922ac611d
Headers show

Comments

Katsunori FUJIWARA - May 6, 2013, 8:35 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1367870651 -32400
#      Tue May 07 05:04:11 2013 +0900
# Branch stable
# Node ID f6c324c8d745ac8efe0e2c72a085adab7a61cd36
# Parent  c35e25c868fcf17fef3239dd43f03031aa5980fb
largefiles: check unknown files with case awareness of the filesystem

Before this patch, largefiles extension checks unknown files in the
working directory always case sensitively.

This causes failure in updating from the revision X consisting of
'.hglf/A' (and "A" implicitly) to the revision Y consisting of 'a'
(not ".hglf/A") on case insensitive filesystem, because "A" in the
working directory is treated as colliding against and different from
'a' on the revision Y.

This patch uses "repo.dirstate.normalize()" to check unknown files
with case awareness of the filesystem.

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -333,7 +333,7 @@ 
 # largefiles. This makes the merge proceed and we can then handle this
 # case further in the overridden manifestmerge function below.
 def overridecheckunknownfile(origfn, repo, wctx, mctx, f):
-    if lfutil.standin(f) in wctx:
+    if lfutil.standin(repo.dirstate.normalize(f)) in wctx:
         return False
     return origfn(repo, wctx, mctx, f)
 
diff --git a/tests/test-casefolding.t b/tests/test-casefolding.t
--- a/tests/test-casefolding.t
+++ b/tests/test-casefolding.t
@@ -128,6 +128,8 @@ 
   $ hg update -q -C 0
   $ hg status -A
   C a
+  $ hg update -q -C 3
+  $ hg update -q 0
 
   $ cd ..