##// END OF EJS Templates
convert: make mapfile handle LF and CRLF shamap (issue1846)
Patrick Mezard -
r9528:314fc589 default
parent child Browse files
Show More
@@ -365,7 +365,7 b' class mapfile(dict):'
365 return
365 return
366 for i, line in enumerate(fp):
366 for i, line in enumerate(fp):
367 try:
367 try:
368 key, value = line[:-1].rsplit(' ', 1)
368 key, value = line.splitlines()[0].rsplit(' ', 1)
369 except ValueError:
369 except ValueError:
370 raise util.Abort(_('syntax error in %s(%d): key/value pair expected')
370 raise util.Abort(_('syntax error in %s(%d): key/value pair expected')
371 % (self.path, i+1))
371 % (self.path, i+1))
@@ -38,6 +38,25 b' cd new'
38 hg out ../orig
38 hg out ../orig
39 cd ..
39 cd ..
40
40
41 echo '% check shamap LF and CRLF handling'
42 cat > rewrite.py <<EOF
43 import sys
44 # Interlace LF and CRLF
45 lines = [(l.rstrip() + ((i % 2) and '\n' or '\r\n'))
46 for i, l in enumerate(file(sys.argv[1]))]
47 file(sys.argv[1], 'wb').write(''.join(lines))
48 EOF
49 python rewrite.py new/.hg/shamap
50 cd orig
51 hg up -qC 1
52 echo foo >> foo
53 hg ci -qm 'change foo again'
54 hg up -qC 2
55 echo foo >> foo
56 hg ci -qm 'change foo again again'
57 cd ..
58 hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
59
41 echo % init broken repository
60 echo % init broken repository
42 hg init broken
61 hg init broken
43 cd broken
62 cd broken
@@ -20,6 +20,12 b' 0 mark baz executable'
20 comparing with ../orig
20 comparing with ../orig
21 searching for changes
21 searching for changes
22 no changes found
22 no changes found
23 % check shamap LF and CRLF handling
24 scanning source...
25 sorting...
26 converting...
27 1 change foo again again
28 0 change foo again
23 % init broken repository
29 % init broken repository
24 created new head
30 created new head
25 % break it
31 % break it
General Comments 0
You need to be logged in to leave comments. Login now