Skip to content

Commit

Permalink
Remove $Id: ..$ $Header: ..$ etc from +ko and +k files during import
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jason McMullan authored and tronical committed Feb 3, 2008
1 parent d8534ad commit f3e9512
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions contrib/fast-import/git-p4
Original file line number Diff line number Diff line change
Expand Up @@ -964,9 +964,13 @@ class P4Sync(Command):
stat = filedata[j]
j += 1
text = ''
while j < len(filedata) and filedata[j]['code'] in ('text',
'binary'):
text += filedata[j]['data']
while j < len(filedata) and filedata[j]['code'] in ('text', 'unicode', 'binary'):
tmp = filedata[j]['data']
if stat['type'] in ('text+ko', 'unicode+ko', 'binary+ko'):
tmp = re.sub(r'(?i)\$(Id|Header):[^$]*\$',r'$\1$', tmp)
elif stat['type'] in ('text+k', 'ktext', 'kxtext', 'unicode+k', 'binary+k'):
tmp = re.sub(r'(?i)\$(Id|Header|Author|Date|DateTime|Change|File|Revision):[^$]*\$',r'$\1$', tmp)
text += tmp
j += 1


Expand Down

0 comments on commit f3e9512

Please sign in to comment.