# HG changeset patch # User Patrick Mezard # Date 2008-12-14 17:13:41 # Node ID 992d78981cbad1fa07cea4e15c29113f7d18f589 # Parent dd66d161a14bee7671ccf9ec8fe5cd48bdad5677 # Parent a8376f2aa3b1d40446ea938f50c7cd40b907c032 Merge with crew-stable diff --git a/hgext/convert/cvs.py b/hgext/convert/cvs.py --- a/hgext/convert/cvs.py +++ b/hgext/convert/cvs.py @@ -328,9 +328,6 @@ class convert_cvs(converter_source): 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) diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -734,7 +734,7 @@ class memctx(object): 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 diff --git a/mercurial/store.py b/mercurial/store.py --- a/mercurial/store.py +++ b/mercurial/store.py @@ -61,6 +61,9 @@ def auxencode(path): # 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 @@ def hybridencode(path): 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 diff --git a/tests/test-hybridencode.py b/tests/test-hybridencode.py --- a/tests/test-hybridencode.py +++ b/tests/test-hybridencode.py @@ -14,3 +14,6 @@ show('data/aux.bla/bla.aux/prn/PRN/lpt/c 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') diff --git a/tests/test-hybridencode.py.out b/tests/test-hybridencode.py.out --- a/tests/test-hybridencode.py.out +++ b/tests/test-hybridencode.py.out @@ -10,3 +10,12 @@ B = 'dh/enterpri/openesba/contrib-/corba 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' +