changeset 24542:9fbda55c68d7

merge with stable
author Matt Mackall <mpm@selenic.com>
date Tue, 31 Mar 2015 16:14:14 -0500
parents e235b5dc5cf9 (current diff) 2bb13f2b778c (diff)
children 747401086a38
files mercurial/dirstate.py mercurial/help/config.txt
diffstat 3 files changed, 27 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Sun Mar 29 19:47:16 2015 -0700
+++ b/mercurial/dirstate.py	Tue Mar 31 16:14:14 2015 -0500
@@ -677,7 +677,7 @@
                         results[nf] = None
                     if matchedir:
                         matchedir(nf)
-                    foundadd(nf)
+                    foundadd((nf, ff))
                 elif kind == regkind or kind == lnkkind:
                     results[nf] = st
                 else:
@@ -753,15 +753,16 @@
         results, work, dirsnotfound = self._walkexplicit(match, subrepos)
 
         skipstep3 = skipstep3 and not (work or dirsnotfound)
-        work = [d for d in work if not dirignore(d)]
+        work = [d for d in work if not dirignore(d[0])]
         wadd = work.append
 
         # step 2: visit subdirectories
         while work:
-            nd = work.pop()
+            nd, d = work.pop()
             skip = None
             if nd == '.':
                 nd = ''
+                d = ''
             else:
                 skip = '.hg'
             try:
@@ -776,22 +777,24 @@
                     # even though f might be a directory, we're only interested
                     # in comparing it to files currently in the dmap --
                     # therefore normalizefile is enough
+                    f = d and (d + "/" + f) or f
                     nf = normalizefile(nd and (nd + "/" + f) or f, True, True)
                 else:
                     nf = nd and (nd + "/" + f) or f
+                    f = nf
                 if nf not in results:
                     if kind == dirkind:
                         if not ignore(nf):
                             if matchtdir:
                                 matchtdir(nf)
-                            wadd(nf)
+                            wadd((nf, f))
                         if nf in dmap and (matchalways or matchfn(nf)):
                             results[nf] = None
                     elif kind == regkind or kind == lnkkind:
                         if nf in dmap:
                             if matchalways or matchfn(nf):
                                 results[nf] = st
-                        elif (matchalways or matchfn(nf)) and not ignore(nf):
+                        elif (matchalways or matchfn(f)) and not ignore(nf):
                             results[nf] = st
                     elif nf in dmap and (matchalways or matchfn(nf)):
                         results[nf] = None
--- a/mercurial/help/config.txt	Sun Mar 29 19:47:16 2015 -0700
+++ b/mercurial/help/config.txt	Tue Mar 31 16:14:14 2015 -0500
@@ -1391,13 +1391,13 @@
     format.
     Defaults to showing the hash, tags, branches, bookmarks, author, and
     the first line of the commit description.
-    You have to pay attention to encodings of managed files, if you
-    use non-ASCII characters in tags, branches, bookmarks, author
-    and/or commit descriptions. At template expansion, non-ASCII
-    characters use the encoding specified by ``--encoding`` global
-    option, ``HGENCODING`` or other locale setting environment
-    variables. The difference of encoding between merged file and
-    conflict markers causes serious problem.
+    If you use non-ASCII characters in names for tags, branches, bookmarks,
+    authors, and/or commit descriptions, you must pay attention to encodings of
+    managed files. At template expansion, non-ASCII characters use the encoding
+    specified by the ``--encoding`` global option, ``HGENCODING`` or other
+    environment variables that govern your locale. If the encoding of the merge
+    markers is different from the encoding of the merged files,
+    serious problems may occur.
 
 ``portablefilenames``
     Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
--- a/tests/test-add.t	Sun Mar 29 19:47:16 2015 -0700
+++ b/tests/test-add.t	Tue Mar 31 16:14:14 2015 -0500
@@ -169,4 +169,16 @@
   $ cat d
   file d
 
+Test that adding a directory doesn't require case matching (issue4578)
+#if icasefs
+  $ mkdir -p CapsDir1/CapsDir
+  $ echo abc > CapsDir1/CapsDir/AbC.txt
+  $ mkdir CapsDir1/CapsDir/SubDir
+  $ echo def > CapsDir1/CapsDir/SubDir/Def.txt
+
+  $ hg add -v capsdir1/capsdir
+  adding CapsDir1/CapsDir/AbC.txt (glob)
+  adding CapsDir1/CapsDir/SubDir/Def.txt (glob)
+#endif
+
   $ cd ..