##// END OF EJS Templates
convert: add config option to control storing original revision...
Gregory Szorc -
r30661:ced0d686 default
parent child Browse files
Show More
@@ -337,6 +337,9 b' def convert(ui, src, dest=None, revmapfi'
337 ``convert.git.remoteprefix`` as a prefix followed by a /. The default
337 ``convert.git.remoteprefix`` as a prefix followed by a /. The default
338 is 'remote'.
338 is 'remote'.
339
339
340 :convert.git.saverev: whether to store the original Git commit ID in the
341 metadata of the destination commit. The default is True.
342
340 :convert.git.skipsubmodules: does not convert root level .gitmodules files
343 :convert.git.skipsubmodules: does not convert root level .gitmodules files
341 or files with 160000 mode indicating a submodule. Default is False.
344 or files with 160000 mode indicating a submodule. Default is False.
342
345
@@ -322,11 +322,13 b' class convert_git(common.converter_sourc'
322 tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:]
322 tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:]
323 tz = -int(tzs) * (int(tzh) * 3600 + int(tzm))
323 tz = -int(tzs) * (int(tzh) * 3600 + int(tzm))
324 date = tm + " " + str(tz)
324 date = tm + " " + str(tz)
325 saverev = self.ui.configbool('convert', 'git.saverev', True)
325
326
326 c = common.commit(parents=parents, date=date, author=author,
327 c = common.commit(parents=parents, date=date, author=author,
327 desc=message,
328 desc=message,
328 rev=version,
329 rev=version,
329 extra=extra)
330 extra=extra,
331 saverev=saverev)
330 return c
332 return c
331
333
332 def numcommits(self):
334 def numcommits(self):
@@ -928,3 +928,58 b' Converting multiple extras works'
928
928
929
929
930
930
931 convert.git.saverev can be disabled to prevent convert_revision from being written
932
933 $ hg convert --config convert.git.saverev=false gitextras hgextras4
934 initializing destination hgextras4 repository
935 scanning source...
936 sorting...
937 converting...
938 1 initial
939 0 message with extras
940 updating bookmarks
941
942 $ hg -R hgextras4 log --debug -r 1
943 changeset: 1:1dcaf4ffe5bee43fa86db2800821f6f0af212c5c
944 bookmark: master
945 tag: tip
946 phase: draft
947 parent: 0:a13935fec4daf06a5a87a7307ccb0fc94f98d06d
948 parent: -1:0000000000000000000000000000000000000000
949 manifest: 0:6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50
950 user: test <test@example.com>
951 date: Sun Sep 09 01:46:40 2001 +0000
952 extra: branch=default
953 description:
954 message with extras
955
956
957
958 convert.git.saverev and convert.git.extrakeys can be combined to preserve
959 convert_revision from source
960
961 $ hg convert --config convert.git.saverev=false --config convert.git.extrakeys=convert_revision gitextras hgextras5
962 initializing destination hgextras5 repository
963 scanning source...
964 sorting...
965 converting...
966 1 initial
967 0 message with extras
968 updating bookmarks
969
970 $ hg -R hgextras5 log --debug -r 1
971 changeset: 1:574d85931544d4542007664fee3747360e85ee28
972 bookmark: master
973 tag: tip
974 phase: draft
975 parent: 0:a13935fec4daf06a5a87a7307ccb0fc94f98d06d
976 parent: -1:0000000000000000000000000000000000000000
977 manifest: 0:6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50
978 user: test <test@example.com>
979 date: Sun Sep 09 01:46:40 2001 +0000
980 extra: branch=default
981 extra: convert_revision=0000aaaabbbbccccddddeeee
982 description:
983 message with extras
984
985
@@ -279,6 +279,9 b''
279 remote refs are converted as bookmarks with
279 remote refs are converted as bookmarks with
280 "convert.git.remoteprefix" as a prefix followed by a /. The
280 "convert.git.remoteprefix" as a prefix followed by a /. The
281 default is 'remote'.
281 default is 'remote'.
282 convert.git.saverev
283 whether to store the original Git commit ID in the metadata
284 of the destination commit. The default is True.
282 convert.git.skipsubmodules
285 convert.git.skipsubmodules
283 does not convert root level .gitmodules files or files with
286 does not convert root level .gitmodules files or files with
284 160000 mode indicating a submodule. Default is False.
287 160000 mode indicating a submodule. Default is False.
General Comments 0
You need to be logged in to leave comments. Login now