changeset 7519:992d78981cba

Merge with crew-stable
author Patrick Mezard <pmezard@gmail.com>
date Sun, 14 Dec 2008 18:13:41 +0100
parents dd66d161a14b (current diff) a8376f2aa3b1 (diff)
children e4ab4802f261
files hgext/convert/cvs.py
diffstat 5 files changed, 19 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/cvs.py	Sat Dec 13 13:28:20 2008 +0100
+++ b/hgext/convert/cvs.py	Sun Dec 14 18:13:41 2008 +0100
@@ -328,9 +328,6 @@
                     self.ui.warn(_("cvs server: %s\n") % line[2:])
                 elif line.startswith("Remove"):
                     l = self.readp.readline()
-                    l = self.readp.readline()
-                    if l != "ok\n":
-                        raise util.Abort(_("unknown CVS response: %s") % l)
                 else:
                     raise util.Abort(_("unknown CVS response: %s") % line)
 
--- a/mercurial/context.py	Sat Dec 13 13:28:20 2008 +0100
+++ b/mercurial/context.py	Sun Dec 14 18:13:41 2008 +0100
@@ -734,7 +734,7 @@
         parents = [(p or nullid) for p in parents]
         p1, p2 = parents
         self._parents = [changectx(self._repo, p) for p in (p1, p2)]
-        files = util.sort(list(files))
+        files = util.sort(util.unique(files))
         self._status = [files, [], [], [], []]
         self._filectxfn = filectxfn
 
--- a/mercurial/store.py	Sat Dec 13 13:28:20 2008 +0100
+++ b/mercurial/store.py	Sun Dec 14 18:13:41 2008 +0100
@@ -61,6 +61,9 @@
                 # encode third letter ('aux' -> 'au~78')
                 ec = "~%02x" % ord(n[2])
                 n = n[0:2] + ec + n[3:]
+            if n[-1] in '. ':
+                # encode last period or space ('foo...' -> 'foo..~2e')
+                n = n[:-1] + "~%02x" % ord(n[-1])
         res.append(n)
     return '/'.join(res)
 
@@ -111,6 +114,9 @@
         sdirs = []
         for p in parts[:-1]:
             d = p[:DIR_PREFIX_LEN]
+            if d[-1] in '. ':
+                # Windows can't access dirs ending in period or space
+                d = d[:-1] + '_'
             t = '/'.join(sdirs) + '/' + d
             if len(t) > _MAX_SHORTENED_DIRS_LEN:
                 break
--- a/tests/test-hybridencode.py	Sat Dec 13 13:28:20 2008 +0100
+++ b/tests/test-hybridencode.py	Sun Dec 14 18:13:41 2008 +0100
@@ -14,3 +14,6 @@
 show('data/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT.i')
 show('data/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider.i')
 show('data/AUX.THE-QUICK-BROWN-FOX-JU:MPS-OVER-THE-LAZY-DOG-THE-QUICK-BROWN-FOX-JUMPS-OVER-THE-LAZY-DOG.TXT.i')
+show('data/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt')
+show('data/Project.Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt')
+show('data/foo.../foo   / /a./_. /__/.x../    bla/something.i')
--- a/tests/test-hybridencode.py.out	Sat Dec 13 13:28:20 2008 +0100
+++ b/tests/test-hybridencode.py.out	Sun Dec 14 18:13:41 2008 +0100
@@ -10,3 +10,12 @@
 A = 'data/AUX.THE-QUICK-BROWN-FOX-JU:MPS-OVER-THE-LAZY-DOG-THE-QUICK-BROWN-FOX-JUMPS-OVER-THE-LAZY-DOG.TXT.i'
 B = 'dh/au~78.the-quick-brown-fox-ju~3amps-over-the-lazy-dog-the-quick-brown-fox-jud4dcadd033000ab2b26eb66bae1906bcb15d4a70.i'
 
+A = 'data/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt'
+B = 'dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilenaf93030515d9849cfdca52937c2204d19f83913e5.txt'
+
+A = 'data/Project.Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt'
+B = 'dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilena0fd7c506f5c9d58204444fc67e9499006bd2d445.txt'
+
+A = 'data/foo.../foo   / /a./_. /__/.x../    bla/something.i'
+B = 'data/foo..~2e/foo  ~20/~20/a~2e/__.~20/____/.x.~2e/    bla/something.i'
+