Show More
@@ -316,6 +316,9 b' def convert(ui, src, dest=None, revmapfi' | |||||
316 | ``convert.git.remoteprefix`` as a prefix followed by a /. The default |
|
316 | ``convert.git.remoteprefix`` as a prefix followed by a /. The default | |
317 | is 'remote'. |
|
317 | is 'remote'. | |
318 |
|
318 | |||
|
319 | :convert.git.skipsubmodules: does not convert root level .gitmodules files | |||
|
320 | or files with 160000 mode indicating a submodule. Default is False. | |||
|
321 | ||||
319 | Perforce Source |
|
322 | Perforce Source | |
320 | ############### |
|
323 | ############### | |
321 |
|
324 |
@@ -224,6 +224,8 b' class convert_git(converter_source):' | |||||
224 | lcount = len(difftree) |
|
224 | lcount = len(difftree) | |
225 | i = 0 |
|
225 | i = 0 | |
226 |
|
226 | |||
|
227 | skipsubmodules = self.ui.configbool('convert', 'git.skipsubmodules', | |||
|
228 | False) | |||
227 | def add(entry, f, isdest): |
|
229 | def add(entry, f, isdest): | |
228 | seen.add(f) |
|
230 | seen.add(f) | |
229 | h = entry[3] |
|
231 | h = entry[3] | |
@@ -232,6 +234,9 b' class convert_git(converter_source):' | |||||
232 | renamesource = (not isdest and entry[4][0] == 'R') |
|
234 | renamesource = (not isdest and entry[4][0] == 'R') | |
233 |
|
235 | |||
234 | if f == '.gitmodules': |
|
236 | if f == '.gitmodules': | |
|
237 | if skipsubmodules: | |||
|
238 | return | |||
|
239 | ||||
235 | subexists[0] = True |
|
240 | subexists[0] = True | |
236 | if entry[4] == 'D' or renamesource: |
|
241 | if entry[4] == 'D' or renamesource: | |
237 | subdeleted[0] = True |
|
242 | subdeleted[0] = True | |
@@ -239,7 +244,8 b' class convert_git(converter_source):' | |||||
239 | else: |
|
244 | else: | |
240 | changes.append(('.hgsub', '')) |
|
245 | changes.append(('.hgsub', '')) | |
241 | elif entry[1] == '160000' or entry[0] == ':160000': |
|
246 | elif entry[1] == '160000' or entry[0] == ':160000': | |
242 | subexists[0] = True |
|
247 | if not skipsubmodules: | |
|
248 | subexists[0] = True | |||
243 | else: |
|
249 | else: | |
244 | if renamesource: |
|
250 | if renamesource: | |
245 | h = hex(nullid) |
|
251 | h = hex(nullid) |
@@ -652,6 +652,12 b' submodules)' | |||||
652 | $ hg -R git-repo6-hg tip -T "{file_dels}\n" |
|
652 | $ hg -R git-repo6-hg tip -T "{file_dels}\n" | |
653 | .hgsub .hgsubstate |
|
653 | .hgsub .hgsubstate | |
654 |
|
654 | |||
|
655 | skip submodules in the conversion | |||
|
656 | ||||
|
657 | $ hg convert -q git-repo6 no-submodules --config convert.git.skipsubmodules=True | |||
|
658 | $ hg -R no-submodules manifest --all | |||
|
659 | .gitmodules-renamed | |||
|
660 | ||||
655 | convert using a different remote prefix |
|
661 | convert using a different remote prefix | |
656 | $ git init git-repo7 |
|
662 | $ git init git-repo7 | |
657 | Initialized empty Git repository in $TESTTMP/git-repo7/.git/ |
|
663 | Initialized empty Git repository in $TESTTMP/git-repo7/.git/ |
@@ -265,6 +265,9 b'' | |||||
265 | remote refs are converted as bookmarks with |
|
265 | remote refs are converted as bookmarks with | |
266 | "convert.git.remoteprefix" as a prefix followed by a /. The |
|
266 | "convert.git.remoteprefix" as a prefix followed by a /. The | |
267 | default is 'remote'. |
|
267 | default is 'remote'. | |
|
268 | convert.git.skipsubmodules | |||
|
269 | does not convert root level .gitmodules files or files with | |||
|
270 | 160000 mode indicating a submodule. Default is False. | |||
268 |
|
271 | |||
269 | Perforce Source |
|
272 | Perforce Source | |
270 | ############### |
|
273 | ############### |
General Comments 0
You need to be logged in to leave comments.
Login now