##// END OF EJS Templates
convert: tolerate embedded spaces in filemap source revisions
Patrick Mezard -
r7073:af1117f3 default
parent child Browse files
Show More
@@ -2,7 +2,7 b''
2 import base64, errno
2 import base64, errno
3 import os
3 import os
4 import cPickle as pickle
4 import cPickle as pickle
5 from mercurial import util
5 from mercurial import util, strutil
6 from mercurial.i18n import _
6 from mercurial.i18n import _
7
7
8 def encodeargs(args):
8 def encodeargs(args):
@@ -334,7 +334,7 b' class mapfile(dict):'
334 raise
334 raise
335 return
335 return
336 for line in fp:
336 for line in fp:
337 key, value = line[:-1].split(' ', 1)
337 key, value = strutil.rsplit(line[:-1], ' ', 1)
338 if key not in self:
338 if key not in self:
339 self.order.append(key)
339 self.order.append(key)
340 super(mapfile, self).__setitem__(key, value)
340 super(mapfile, self).__setitem__(key, value)
@@ -32,3 +32,10 b' def rfindall(haystack, needle, start=0, '
32 break
32 break
33 yield c
33 yield c
34 end = c - 1
34 end = c - 1
35
36 def rsplit(s, sep=None, maxsplit=-1):
37 try:
38 return s.rsplit(sep, maxsplit)
39 except AttributeError:
40 return [chunk[::-1] for chunk in
41 s[::-1].split(sep, maxsplit)[::-1]]
General Comments 0
You need to be logged in to leave comments. Login now