equal
deleted
inserted
replaced
5 # This software may be used and distributed according to the terms of the |
5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. |
6 # GNU General Public License version 2 or any later version. |
7 |
7 |
8 import os |
8 import os |
9 from mercurial import util |
9 from mercurial import util |
|
10 from mercurial.i18n import _ |
10 |
11 |
11 from common import NoRepo, commit, converter_source, checktool |
12 from common import NoRepo, commit, converter_source, checktool |
12 |
13 |
13 class convert_git(converter_source): |
14 class convert_git(converter_source): |
14 # Windows does not support GIT_DIR= construct while other systems |
15 # Windows does not support GIT_DIR= construct while other systems |
33 super(convert_git, self).__init__(ui, path, rev=rev) |
34 super(convert_git, self).__init__(ui, path, rev=rev) |
34 |
35 |
35 if os.path.isdir(path + "/.git"): |
36 if os.path.isdir(path + "/.git"): |
36 path += "/.git" |
37 path += "/.git" |
37 if not os.path.exists(path + "/objects"): |
38 if not os.path.exists(path + "/objects"): |
38 raise NoRepo("%s does not look like a Git repository" % path) |
39 raise NoRepo(_("%s does not look like a Git repository") % path) |
39 |
40 |
40 checktool('git', 'git') |
41 checktool('git', 'git') |
41 |
42 |
42 self.path = path |
43 self.path = path |
43 |
44 |