Show More
@@ -7,7 +7,7 b'' | |||||
7 |
|
7 | |||
8 | import os |
|
8 | import os | |
9 | import subprocess |
|
9 | import subprocess | |
10 | from mercurial import util, config |
|
10 | from mercurial import util, config, error | |
11 | from mercurial.node import hex, nullid |
|
11 | from mercurial.node import hex, nullid | |
12 | from mercurial.i18n import _ |
|
12 | from mercurial.i18n import _ | |
13 |
|
13 | |||
@@ -185,9 +185,19 b' class convert_git(converter_source):' | |||||
185 | def retrievegitmodules(self, version): |
|
185 | def retrievegitmodules(self, version): | |
186 | modules, ret = self.gitread("git show %s:%s" % (version, '.gitmodules')) |
|
186 | modules, ret = self.gitread("git show %s:%s" % (version, '.gitmodules')) | |
187 | if ret: |
|
187 | if ret: | |
188 | raise util.Abort(_('cannot read submodules config file in %s') % |
|
188 | # This can happen if a file is in the repo that has permissions | |
189 | version) |
|
189 | # 160000, but there is no .gitmodules file. | |
190 | self.parsegitmodules(modules) |
|
190 | self.ui.warn(_("warning: cannot read submodules config file in " | |
|
191 | "%s\n") % version) | |||
|
192 | return | |||
|
193 | ||||
|
194 | try: | |||
|
195 | self.parsegitmodules(modules) | |||
|
196 | except error.ParseError: | |||
|
197 | self.ui.warn(_("warning: unable to parse .gitmodules in %s\n") | |||
|
198 | % version) | |||
|
199 | return | |||
|
200 | ||||
191 | for m in self.submodules: |
|
201 | for m in self.submodules: | |
192 | node, ret = self.gitread("git rev-parse %s:%s" % (version, m.path)) |
|
202 | node, ret = self.gitread("git rev-parse %s:%s" % (version, m.path)) | |
193 | if ret: |
|
203 | if ret: |
@@ -482,6 +482,39 b' test non-tab whitespace .gitmodules' | |||||
482 | $ rm -rf hg-repo6 |
|
482 | $ rm -rf hg-repo6 | |
483 | $ cd git-repo6 |
|
483 | $ cd git-repo6 | |
484 | $ git reset --hard 'HEAD^' > /dev/null |
|
484 | $ git reset --hard 'HEAD^' > /dev/null | |
|
485 | ||||
|
486 | test missing .gitmodules | |||
|
487 | ||||
|
488 | $ git submodule add ../git-repo4 >/dev/null 2>/dev/null | |||
|
489 | $ git checkout HEAD .gitmodules | |||
|
490 | $ git rm .gitmodules | |||
|
491 | rm '.gitmodules' | |||
|
492 | $ git commit -m "remove .gitmodules" .gitmodules | |||
|
493 | [master *] remove .gitmodules (glob) | |||
|
494 | Author: nottest <test@example.org> | |||
|
495 | 1 file changed, 3 deletions(-) | |||
|
496 | delete mode 100644 .gitmodules | |||
|
497 | $ git commit -m "missing .gitmodules" | |||
|
498 | [master *] missing .gitmodules (glob) | |||
|
499 | Author: nottest <test@example.org> | |||
|
500 | 1 file changed, 1 insertion(+) | |||
|
501 | create mode 160000 git-repo4 | |||
|
502 | $ cd .. | |||
|
503 | $ hg convert git-repo6 hg-repo6 --traceback | |||
|
504 | fatal: Path '.gitmodules' does not exist in '*' (glob) | |||
|
505 | initializing destination hg-repo6 repository | |||
|
506 | scanning source... | |||
|
507 | sorting... | |||
|
508 | converting... | |||
|
509 | 2 addsubmodule | |||
|
510 | 1 remove .gitmodules | |||
|
511 | 0 missing .gitmodules | |||
|
512 | warning: cannot read submodules config file in * (glob) | |||
|
513 | updating bookmarks | |||
|
514 | $ rm -rf hg-repo6 | |||
|
515 | $ cd git-repo6 | |||
|
516 | $ rm -rf git-repo4 | |||
|
517 | $ git reset --hard 'HEAD^^' > /dev/null | |||
485 | $ cd .. |
|
518 | $ cd .. | |
486 |
|
519 | |||
487 | test invalid splicemap1 |
|
520 | test invalid splicemap1 |
General Comments 0
You need to be logged in to leave comments.
Login now