开发者

How to remove SVN history from java files?

开发者 https://www.devze.com 2023-04-09 06:21 出处:网络
I have various projects that had files with SVN history in them. I recently moved those projects to a Mercurial repository so now that history within the file is useless. Is there a way to remove thos

I have various projects that had files with SVN history in them. I recently moved those projects to a Mercurial repository so now that history within the file is useless. Is there a way to remove those which is not by hand?

Here's an example:

/*
 * $Rev:x$
 * $LastChangedDate:x$
 * $LastChangedBy:x$
 */

Where x is a value in the files. I assume some sort of regex would help. Any idea?

Edit:

This is the working answer:

<target name="remove-svn-history">
    <replaceregexp byline="false" match="\A/\*.*?\*/" replace="">
        <file开发者_StackOverflow社区set dir="src" includes="**/*.java"/>
    </replaceregexp>
</target>


Assuming that's at the beginning of the file, you could match it with the following regex:

\A/\*.*?\*/
0

精彩评论

暂无评论...
验证码 换一张
取 消