[PATCH 4 of 8] Fix for issue 1092 (hg add gives wrong result when filename case doesn't match)

Paul Moore p.f.moore at gmail.com
Wed Apr 30 12:37:26 CDT 2008


# HG changeset patch
# User "Paul Moore <p.f.moore at gmail.com>"
# Date 1209573965 -3600
# Node ID c7ddd7a0bf7b980bf39ccd206cf19ca86f95f281
# Parent  5019b1549bd8859012b7954c649345d344149bec
Fix for issue 1092 (hg add gives wrong result when filename case doesn't match)

In commands.add, use the fspath return value from cmdutil.walk, to add the
file with the correct case.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -36,11 +36,11 @@
         if exact:
             if ui.verbose:
                 ui.status(_('adding %s\n') % rel)
-            names.append(abs)
-            exacts[abs] = 1
-        elif abs not in repo.dirstate:
+            names.append(fsabs)
+            exacts[fsabs] = 1
+        elif fsabs not in repo.dirstate:
             ui.status(_('adding %s\n') % rel)
-            names.append(abs)
+            names.append(fsabs)
     if not opts.get('dry_run'):
         rejected = repo.add(names)
         rejected = [p for p in rejected if p in exacts]


More information about the Mercurial-devel mailing list