{"thread":{"id":"15480","subject":"Re: PATCH: git-p4 optional handling of RCS keywords","startedAt":"2008-09-10T19:18:52Z","lastAt":"2008-09-10T19:18:52Z","messageCount":1,"participants":["Simon Hausmann"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"90378","messageId":"200809102119.01630.simon@lst.de","threadId":"15480","inReplyTo":"646617.59689.qm@web95011.mail.in2.yahoo.com","subject":"Re: PATCH: git-p4 optional handling of RCS keywords","fromName":"Simon Hausmann","fromEmail":"simon@lst.de","sentAt":"2008-09-10T19:18:52Z","receivedAt":"2008-09-10T19:18:52Z","isPatch":false,"sender":{"key":"hausmann@kde.org","avatar":"https://gravatar.com/avatar/bc9aad4fb31dce17eb66e690e7b51fe980c62da3c225c785da35dd806b8da778?d=mp&s=160"},"body":"On Wednesday 10 September 2008 08:29:56 dhruva wrote:\n> Hi,\n>  Incorporated the style tip, sure makes it look cleaner.\n>\n> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\n> index 2216cac..3e72e43 100755\n> --- a/contrib/fast-import/git-p4\n> +++ b/contrib/fast-import/git-p4\n> @@ -16,6 +16,9 @@ from sets import Set;\n>\n>  verbose = False\n>\n> +# Handling of RCS keyowrds. To ensure backward compatibility, the default\n> +# is to strip keywords. Default behavior is controlled here\n> +kwstrip = True\n>\n>  def p4_build_cmd(cmd):\n>      \"\"\"Build a suitable p4 command line.\n> @@ -975,7 +978,9 @@ class P4Sync(Command):\n>                  sys.stderr.write(\"p4 print fails with: %s\\n\" % repr(stat))\n>                  continue\n>\n> -            if stat['type'] in ('text+ko', 'unicode+ko', 'binary+ko'):\n> +            if not kwstrip:\n> +               pass\n> +            elif stat['type'] in ('text+ko', 'unicode+ko', 'binary+ko'):\n>                  text = re.sub(r'(?i)\\$(Id|Header):[^$]*\\$',r'$\\1$', text)\n>              elif stat['type'] in ('text+k', 'ktext', 'kxtext',\n> 'unicode+k', 'binary+k'): text =\n> re.sub(r'\\$(Id|Header|Author|Date|DateTime|Change|File|Revision):[^$]*\\$',r\n>'$\\1$', text) @@ -1850,6 +1855,16 @@ def main():\n>          (cmd, args) = parser.parse_args(sys.argv[2:], cmd);\n>      global verbose\n>      verbose = cmd.verbose\n> +\n> +    global kwstrip\n> +    kwval = gitConfig(\"git-p4.kwstrip\")\n> +    if len(kwval) > 0:\n> +       kwval = kwval.lower();\n> +        if \"false\" == kwval:\n> +            kwstrip = False\n> +        elif \"true\" == kwval:\n> +            kwstrip = True\n\nI have another style nitpick, sorry :). Please use \"kwval == \"false\" instead \nof the other way around.\n\nOtherwise your patch looks good to me, I think it's a very good option to add. \nPlease resend with commit message so that Junio can include it.\n\n\nSimon\n"}]}