##// END OF EJS Templates
convert: add convert.git.skipsubmodules option...
Durham Goode -
r26077:e63d05fb default
parent child Browse files
Show More
@@ -316,6 +316,9 b' def convert(ui, src, dest=None, revmapfi'
316 316 ``convert.git.remoteprefix`` as a prefix followed by a /. The default
317 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 322 Perforce Source
320 323 ###############
321 324
@@ -224,6 +224,8 b' class convert_git(converter_source):'
224 224 lcount = len(difftree)
225 225 i = 0
226 226
227 skipsubmodules = self.ui.configbool('convert', 'git.skipsubmodules',
228 False)
227 229 def add(entry, f, isdest):
228 230 seen.add(f)
229 231 h = entry[3]
@@ -232,6 +234,9 b' class convert_git(converter_source):'
232 234 renamesource = (not isdest and entry[4][0] == 'R')
233 235
234 236 if f == '.gitmodules':
237 if skipsubmodules:
238 return
239
235 240 subexists[0] = True
236 241 if entry[4] == 'D' or renamesource:
237 242 subdeleted[0] = True
@@ -239,7 +244,8 b' class convert_git(converter_source):'
239 244 else:
240 245 changes.append(('.hgsub', ''))
241 246 elif entry[1] == '160000' or entry[0] == ':160000':
242 subexists[0] = True
247 if not skipsubmodules:
248 subexists[0] = True
243 249 else:
244 250 if renamesource:
245 251 h = hex(nullid)
@@ -652,6 +652,12 b' submodules)'
652 652 $ hg -R git-repo6-hg tip -T "{file_dels}\n"
653 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 661 convert using a different remote prefix
656 662 $ git init git-repo7
657 663 Initialized empty Git repository in $TESTTMP/git-repo7/.git/
@@ -265,6 +265,9 b''
265 265 remote refs are converted as bookmarks with
266 266 "convert.git.remoteprefix" as a prefix followed by a /. The
267 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 272 Perforce Source
270 273 ###############
General Comments 0
You need to be logged in to leave comments. Login now