{"thread":{"id":"39441","subject":"[PATCH] p4: Retrieve the right revision of the UTF-16 file","startedAt":"2015-05-27T22:04:34Z","lastAt":"2015-05-27T23:14:39Z","messageCount":4,"participants":["Miguel Torroja","Luke Diamand","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"262287","messageId":"55663F72.6010800@diamand.org","threadId":"39441","inReplyTo":"1432765918-7352-1-git-send-email-miguel.torroja@gmail.com","subject":"Re: [PATCH] p4: Retrieve the right revision of the UTF-16 file","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-05-27T22:04:34Z","receivedAt":"2015-05-27T22:04:34Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 27/05/15 23:31, Miguel Torroja wrote:\n> Fixing bug with UTF-16 files when they are retreived by git-p4.\n> It was always getting the tip version of the file and the history of the\n> file was lost.\n\nThis looks sensible to me, and seems to work in some simple testing, thanks!\n\nAck.\n\nLuke\n\n\n> ---\n>   git-p4.py |    2 +-\n>   1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/git-p4.py b/git-p4.py\n> index cdfa2df..be2c7da 100755\n> --- a/git-p4.py\n> +++ b/git-p4.py\n> @@ -2098,7 +2098,7 @@ class P4Sync(Command, P4UserMap):\n>               # them back too.  This is not needed to the cygwin windows version,\n>               # just the native \"NT\" type.\n>               #\n> -            text = p4_read_pipe(['print', '-q', '-o', '-', file['depotFile']])\n> +            text = p4_read_pipe(['print', '-q', '-o', '-', \"%s@%s\" % (file['depotFile'], file['change']) ])\n>               if p4_version_string().find(\"/NT\") >= 0:\n>                   text = text.replace(\"\\r\\n\", \"\\n\")\n>               contents = [ text ]\n>\n"},{"id":"262288","messageId":"CAPc5daW=BEPiGn6BGbN+JHczV-cPTW7WbZmr8vRRdpb1JL_aLQ@mail.gmail.com","threadId":"39441","inReplyTo":"55663F72.6010800@diamand.org","subject":"Re: [PATCH] p4: Retrieve the right revision of the UTF-16 file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-27T22:10:01Z","receivedAt":"2015-05-27T22:10:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"On Wed, May 27, 2015 at 3:04 PM, Luke Diamand <luke@diamand.org> wrote:\n> On 27/05/15 23:31, Miguel Torroja wrote:\n>>\n>> Fixing bug with UTF-16 files when they are retreived by git-p4.\n>> It was always getting the tip version of the file and the history of the\n>> file was lost.\n>\n> This looks sensible to me, and seems to work in some simple testing, thanks!\n>\n> Ack.\n>\n> Luke\n\nThanks; Miguel, please sign-off your patch; otherwise we cannot use it.\n\nThanks.\n\n>> ---\n>>   git-p4.py |    2 +-\n>>   1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> diff --git a/git-p4.py b/git-p4.py\n>> index cdfa2df..be2c7da 100755\n>> --- a/git-p4.py\n>> +++ b/git-p4.py\n>> @@ -2098,7 +2098,7 @@ class P4Sync(Command, P4UserMap):\n>>               # them back too.  This is not needed to the cygwin windows\n>> version,\n>>               # just the native \"NT\" type.\n>>               #\n>> -            text = p4_read_pipe(['print', '-q', '-o', '-',\n>> file['depotFile']])\n>> +            text = p4_read_pipe(['print', '-q', '-o', '-', \"%s@%s\" %\n>> (file['depotFile'], file['change']) ])\n>>               if p4_version_string().find(\"/NT\") >= 0:\n>>                   text = text.replace(\"\\r\\n\", \"\\n\")\n>>               contents = [ text ]\n>>\n>\n"},{"id":"262265","messageId":"1432765918-7352-1-git-send-email-miguel.torroja@gmail.com","threadId":"39441","inReplyTo":null,"subject":"[PATCH] p4: Retrieve the right revision of the UTF-16 file","fromName":"Miguel Torroja","fromEmail":"miguel.torroja@gmail.com","sentAt":"2015-05-27T22:31:58Z","receivedAt":"2015-05-27T22:31:58Z","isPatch":true,"sender":{"key":"miguel.torroja@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5366212?v=4"},"body":"Fixing bug with UTF-16 files when they are retreived by git-p4.\nIt was always getting the tip version of the file and the history of the\nfile was lost.\n---\n git-p4.py |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex cdfa2df..be2c7da 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -2098,7 +2098,7 @@ class P4Sync(Command, P4UserMap):\n             # them back too.  This is not needed to the cygwin windows version,\n             # just the native \"NT\" type.\n             #\n-            text = p4_read_pipe(['print', '-q', '-o', '-', file['depotFile']])\n+            text = p4_read_pipe(['print', '-q', '-o', '-', \"%s@%s\" % (file['depotFile'], file['change']) ])\n             if p4_version_string().find(\"/NT\") >= 0:\n                 text = text.replace(\"\\r\\n\", \"\\n\")\n             contents = [ text ]\n-- \n1.7.10.4\n"},{"id":"262299","messageId":"1432768479-7894-1-git-send-email-miguel.torroja@gmail.com","threadId":"39441","inReplyTo":"CAPc5daW=BEPiGn6BGbN+JHczV-cPTW7WbZmr8vRRdpb1JL_aLQ@mail.gmail.com","subject":"[PATCH] p4: Retrieve the right revision of the UTF-16 file","fromName":"Miguel Torroja","fromEmail":"miguel.torroja@gmail.com","sentAt":"2015-05-27T23:14:39Z","receivedAt":"2015-05-27T23:14:39Z","isPatch":true,"sender":{"key":"miguel.torroja@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5366212?v=4"},"body":"Fixing bug with UTF-16 files when they are retrieved by git-p4.\nIt was always getting the tip version of the file and the history of the\nfile was lost.\n\nSigned-off-by: Miguel Torroja <miguel.torroja@gmail.com>\n---\n git-p4.py |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex cdfa2df..be2c7da 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -2098,7 +2098,7 @@ class P4Sync(Command, P4UserMap):\n             # them back too.  This is not needed to the cygwin windows version,\n             # just the native \"NT\" type.\n             #\n-            text = p4_read_pipe(['print', '-q', '-o', '-', file['depotFile']])\n+            text = p4_read_pipe(['print', '-q', '-o', '-', \"%s@%s\" % (file['depotFile'], file['change']) ])\n             if p4_version_string().find(\"/NT\") >= 0:\n                 text = text.replace(\"\\r\\n\", \"\\n\")\n             contents = [ text ]\n-- \n1.7.10.4\n"}]}