##// END OF EJS Templates
convert: ignore blank lines in mapfiles (issue3286)
Patrick Mezard -
r16190:9479c28a stable
parent child Browse files
Show More
@@ -385,8 +385,12 b' class mapfile(dict):'
385 raise
385 raise
386 return
386 return
387 for i, line in enumerate(fp):
387 for i, line in enumerate(fp):
388 line = line.splitlines()[0].rstrip()
389 if not line:
390 # Ignore blank lines
391 continue
388 try:
392 try:
389 key, value = line.splitlines()[0].rstrip().rsplit(' ', 1)
393 key, value = line.rsplit(' ', 1)
390 except ValueError:
394 except ValueError:
391 raise util.Abort(
395 raise util.Abort(
392 _('syntax error in %s(%d): key/value pair expected')
396 _('syntax error in %s(%d): key/value pair expected')
@@ -418,8 +422,12 b' def parsesplicemap(path):'
418 try:
422 try:
419 fp = open(path, 'r')
423 fp = open(path, 'r')
420 for i, line in enumerate(fp):
424 for i, line in enumerate(fp):
425 line = line.splitlines()[0].rstrip()
426 if not line:
427 # Ignore blank lines
428 continue
421 try:
429 try:
422 child, parents = line.splitlines()[0].rstrip().split(' ', 1)
430 child, parents = line.split(' ', 1)
423 parents = parents.replace(',', ' ').split()
431 parents = parents.replace(',', ' ').split()
424 except ValueError:
432 except ValueError:
425 raise util.Abort(_('syntax error in %s(%d): child parent1'
433 raise util.Abort(_('syntax error in %s(%d): child parent1'
@@ -67,10 +67,12 b' splice repo2 on repo1'
67 $ cat > splicemap <<EOF
67 $ cat > splicemap <<EOF
68 > $CHILDID1 $PARENTID1
68 > $CHILDID1 $PARENTID1
69 > $CHILDID2 $PARENTID2,$CHILDID1
69 > $CHILDID2 $PARENTID2,$CHILDID1
70 >
70 > EOF
71 > EOF
71 $ cat splicemap
72 $ cat splicemap
72 527cdedf31fbd5ea708aa14eeecf53d4676f38db 6d4c2037ddc2cb2627ac3a244ecce35283268f8e
73 527cdedf31fbd5ea708aa14eeecf53d4676f38db 6d4c2037ddc2cb2627ac3a244ecce35283268f8e
73 e4ea00df91897da3079a10fab658c1eddba6617b e55c719b85b60e5102fac26110ba626e7cb6b7dc,527cdedf31fbd5ea708aa14eeecf53d4676f38db
74 e4ea00df91897da3079a10fab658c1eddba6617b e55c719b85b60e5102fac26110ba626e7cb6b7dc,527cdedf31fbd5ea708aa14eeecf53d4676f38db
75
74 $ hg clone repo1 target1
76 $ hg clone repo1 target1
75 updating to branch default
77 updating to branch default
76 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -14,6 +14,8 b' Convert trunk and branches'
14
14
15 $ cat > branchmap <<EOF
15 $ cat > branchmap <<EOF
16 > old3 newbranch
16 > old3 newbranch
17 >
18 >
17 > EOF
19 > EOF
18 $ hg convert --branchmap=branchmap --datesort -r 10 svn-repo A-hg
20 $ hg convert --branchmap=branchmap --datesort -r 10 svn-repo A-hg
19 initializing destination A-hg repository
21 initializing destination A-hg repository
General Comments 0
You need to be logged in to leave comments. Login now