mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
convert: tolerate trailing spaces on map files
A convert run with a branchmap made with echo default namedbranch > branchmap on Windows fails silently and surprisingly; it actually adds a space after 'namedbranch', so it ends up mapping "default namedbranch" to "". This also affects splicemaps, since the same parser is used for both.
This commit is contained in:
parent
7a8d1bb9db
commit
307a2fdf03
@ -384,7 +384,7 @@ class mapfile(dict):
|
||||
return
|
||||
for i, line in enumerate(fp):
|
||||
try:
|
||||
key, value = line.splitlines()[0].rsplit(' ', 1)
|
||||
key, value = line.splitlines()[0].rstrip().rsplit(' ', 1)
|
||||
except ValueError:
|
||||
raise util.Abort(
|
||||
_('syntax error in %s(%d): key/value pair expected')
|
||||
|
@ -49,7 +49,7 @@ test invalid splicemap
|
||||
splice repo2 on repo1
|
||||
|
||||
$ cat > splicemap <<EOF
|
||||
> $CHILDID1 $PARENTID1
|
||||
> $CHILDID1 $PARENTID1
|
||||
> $CHILDID2 $PARENTID2,$CHILDID1
|
||||
> EOF
|
||||
$ hg clone repo1 target1
|
||||
|
Loading…
Reference in New Issue
Block a user