]> git.ipfire.org Git - thirdparty/git.git/commitdiff
p4: retrieve the right revision of the file in UTF-16 codepath
authorMiguel Torroja <miguel.torroja@gmail.com>
Wed, 27 May 2015 23:14:39 +0000 (01:14 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 May 2015 23:23:02 +0000 (16:23 -0700)
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>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-p4.py

index 41a77e6648ddad9a7599452bf361fd13ff4dcf88..d0df1d92e0eaee1d3ba54e09860f00b42ee03d6b 100755 (executable)
--- a/git-p4.py
+++ b/git-p4.py
@@ -2145,7 +2145,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 ]