summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJason McMullan <mcmullan@netapp.com>2007-12-05 12:16:56 -0500
committerSimon Hausmann <simon@lst.de>2008-02-03 19:18:33 +0100
commitf3e9512be1c7935b8ca496f3687c6850b32a06f3 (patch)
treebd548ce349e55593c2e19c5e34d55f711dc340a7 /contrib
parentd8534adac756a71a897b3a433eaea7992a137b71 (diff)
downloadgit-f3e9512be1c7935b8ca496f3687c6850b32a06f3.tar.gz
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>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/git-p410
1 files changed, 7 insertions, 3 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index c80a6da252..31c5501d11 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -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