##// END OF EJS Templates
convert: handle .gitmodules with non-tab whitespaces...
Durham Goode -
r25698:307370c2 default
parent child Browse files
Show More
@@ -174,8 +174,9 b' class convert_git(converter_source):'
174 """
174 """
175 self.submodules = []
175 self.submodules = []
176 c = config.config()
176 c = config.config()
177 # Each item in .gitmodules starts with \t that cant be parsed
177 # Each item in .gitmodules starts with whitespace that cant be parsed
178 c.parse('.gitmodules', content.replace('\t',''))
178 c.parse('.gitmodules', '\n'.join(line.strip() for line in
179 content.split('\n')))
179 for sec in c.sections():
180 for sec in c.sections():
180 s = c[sec]
181 s = c[sec]
181 if 'url' in s and 'path' in s:
182 if 'url' in s and 'path' in s:
@@ -457,6 +457,31 b' test sub modules'
457 $ git init-db >/dev/null 2>/dev/null
457 $ git init-db >/dev/null 2>/dev/null
458 $ git submodule add ${BASE} >/dev/null 2>/dev/null
458 $ git submodule add ${BASE} >/dev/null 2>/dev/null
459 $ commit -a -m 'addsubmodule' >/dev/null 2>/dev/null
459 $ commit -a -m 'addsubmodule' >/dev/null 2>/dev/null
460
461 test non-tab whitespace .gitmodules
462
463 $ cat >> .gitmodules <<EOF
464 > [submodule "git-repo5"]
465 > path = git-repo5
466 > url = $TESTTMP/git-repo5
467 > EOF
468 $ git commit -a -m "weird white space submodule"
469 [master *] weird white space submodule (glob)
470 Author: nottest <test@example.org>
471 1 file changed, 3 insertions(+)
472 $ cd ..
473 $ hg convert git-repo6 hg-repo6
474 initializing destination hg-repo6 repository
475 scanning source...
476 sorting...
477 converting...
478 1 addsubmodule
479 0 weird white space submodule
480 updating bookmarks
481
482 $ rm -rf hg-repo6
483 $ cd git-repo6
484 $ git reset --hard 'HEAD^' > /dev/null
460 $ cd ..
485 $ cd ..
461
486
462 test invalid splicemap1
487 test invalid splicemap1
General Comments 0
You need to be logged in to leave comments. Login now