@matheusbsbs / matheus-bagliano / commits / f3e9512be1
Fork 0

Remove $Id: ..$ $Header: ..$ etc from +ko and +k files during import

This patch removes the '$Keyword: ...$' '...' data, so that files don't have spurious megre conflicts between branches. Handles both +ko and +k styles, and leaves the '$Foo$' in the original file. Signed-off-by: Simon Hausmann <simon@lst.de>

Jason McMullan committed Dec 5, 2007 at 12:16 UTC f3e9512be1c7935b8ca496f3687c6850b32a06f3
1 file changed +7 -3
contrib/fast-import/git-p4
+7 -3
@@ -964,9 +964,13 @@ class P4Sync(Command):
964 stat = filedata[j]
965 j += 1
966 text = ''
967 - while j < len(filedata) and filedata[j]['code'] in ('text',
968 - 'binary'):
969 - text += filedata[j]['data']
967 + while j < len(filedata) and filedata[j]['code'] in ('text', 'unicode', 'binary'):
968 + tmp = filedata[j]['data']
969 + if stat['type'] in ('text+ko', 'unicode+ko', 'binary+ko'):
970 + tmp = re.sub(r'(?i)\$(Id|Header):[^$]*\$',r'$\1$', tmp)
971 + elif stat['type'] in ('text+k', 'ktext', 'kxtext', 'unicode+k', 'binary+k'):
972 + tmp = re.sub(r'(?i)\$(Id|Header|Author|Date|DateTime|Change|File|Revision):[^$]*\$',r'$\1$', tmp)
973 + text += tmp
974 j += 1
975
976