git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] p4: Retrieve the right revision of the UTF-16 file
  2015-05-27 22:31 [PATCH] p4: Retrieve the right revision of the UTF-16 file Miguel Torroja
@ 2015-05-27 22:04 ` Luke Diamand
  2015-05-27 22:10   ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Luke Diamand @ 2015-05-27 22:04 UTC (permalink / raw)
  To: Miguel Torroja, git; +Cc: Junio C Hamano

On 27/05/15 23:31, Miguel Torroja wrote:
> Fixing bug with UTF-16 files when they are retreived by git-p4.
> It was always getting the tip version of the file and the history of the
> file was lost.

This looks sensible to me, and seems to work in some simple testing, thanks!

Ack.

Luke


> ---
>   git-p4.py |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-p4.py b/git-p4.py
> index cdfa2df..be2c7da 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -2098,7 +2098,7 @@ class P4Sync(Command, P4UserMap):
>               # them back too.  This is not needed to the cygwin windows version,
>               # just the native "NT" type.
>               #
> -            text = p4_read_pipe(['print', '-q', '-o', '-', file['depotFile']])
> +            text = p4_read_pipe(['print', '-q', '-o', '-', "%s@%s" % (file['depotFile'], file['change']) ])
>               if p4_version_string().find("/NT") >= 0:
>                   text = text.replace("\r\n", "\n")
>               contents = [ text ]
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] p4: Retrieve the right revision of the UTF-16 file
  2015-05-27 22:04 ` Luke Diamand
@ 2015-05-27 22:10   ` Junio C Hamano
  2015-05-27 23:14     ` Miguel Torroja
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2015-05-27 22:10 UTC (permalink / raw)
  To: Luke Diamand; +Cc: Miguel Torroja, Git Mailing List

On Wed, May 27, 2015 at 3:04 PM, Luke Diamand <luke@diamand.org> wrote:
> On 27/05/15 23:31, Miguel Torroja wrote:
>>
>> Fixing bug with UTF-16 files when they are retreived by git-p4.
>> It was always getting the tip version of the file and the history of the
>> file was lost.
>
> This looks sensible to me, and seems to work in some simple testing, thanks!
>
> Ack.
>
> Luke

Thanks; Miguel, please sign-off your patch; otherwise we cannot use it.

Thanks.

>> ---
>>   git-p4.py |    2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/git-p4.py b/git-p4.py
>> index cdfa2df..be2c7da 100755
>> --- a/git-p4.py
>> +++ b/git-p4.py
>> @@ -2098,7 +2098,7 @@ class P4Sync(Command, P4UserMap):
>>               # them back too.  This is not needed to the cygwin windows
>> version,
>>               # just the native "NT" type.
>>               #
>> -            text = p4_read_pipe(['print', '-q', '-o', '-',
>> file['depotFile']])
>> +            text = p4_read_pipe(['print', '-q', '-o', '-', "%s@%s" %
>> (file['depotFile'], file['change']) ])
>>               if p4_version_string().find("/NT") >= 0:
>>                   text = text.replace("\r\n", "\n")
>>               contents = [ text ]
>>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] p4: Retrieve the right revision of the UTF-16 file
@ 2015-05-27 22:31 Miguel Torroja
  2015-05-27 22:04 ` Luke Diamand
  0 siblings, 1 reply; 4+ messages in thread
From: Miguel Torroja @ 2015-05-27 22:31 UTC (permalink / raw)
  To: git; +Cc: Miguel Torroja

Fixing bug with UTF-16 files when they are retreived by git-p4.
It was always getting the tip version of the file and the history of the
file was lost.
---
 git-p4.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-p4.py b/git-p4.py
index cdfa2df..be2c7da 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2098,7 +2098,7 @@ class P4Sync(Command, P4UserMap):
             # them back too.  This is not needed to the cygwin windows version,
             # just the native "NT" type.
             #
-            text = p4_read_pipe(['print', '-q', '-o', '-', file['depotFile']])
+            text = p4_read_pipe(['print', '-q', '-o', '-', "%s@%s" % (file['depotFile'], file['change']) ])
             if p4_version_string().find("/NT") >= 0:
                 text = text.replace("\r\n", "\n")
             contents = [ text ]
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] p4: Retrieve the right revision of the UTF-16 file
  2015-05-27 22:10   ` Junio C Hamano
@ 2015-05-27 23:14     ` Miguel Torroja
  0 siblings, 0 replies; 4+ messages in thread
From: Miguel Torroja @ 2015-05-27 23:14 UTC (permalink / raw)
  To: git; +Cc: gitster, luke, Miguel Torroja

Fixing bug with UTF-16 files when they are retrieved by git-p4.
It was always getting the tip version of the file and the history of the
file was lost.

Signed-off-by: Miguel Torroja <miguel.torroja@gmail.com>
---
 git-p4.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-p4.py b/git-p4.py
index cdfa2df..be2c7da 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2098,7 +2098,7 @@ class P4Sync(Command, P4UserMap):
             # them back too.  This is not needed to the cygwin windows version,
             # just the native "NT" type.
             #
-            text = p4_read_pipe(['print', '-q', '-o', '-', file['depotFile']])
+            text = p4_read_pipe(['print', '-q', '-o', '-', "%s@%s" % (file['depotFile'], file['change']) ])
             if p4_version_string().find("/NT") >= 0:
                 text = text.replace("\r\n", "\n")
             contents = [ text ]
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-27 23:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-27 22:31 [PATCH] p4: Retrieve the right revision of the UTF-16 file Miguel Torroja
2015-05-27 22:04 ` Luke Diamand
2015-05-27 22:10   ` Junio C Hamano
2015-05-27 23:14     ` Miguel Torroja

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).