git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-p4: Fetch the proper revision of utf16 files

From
DBDaniel Bingham <daniel@dbingham.com>
Date
Apr 3, 2015, 21:13 UTC
Message-ID
<1428095627-8772-2-git-send-email-git@dbingham.com>
In-Reply-To
<1428095627-8772-1-git-send-email-git@dbingham.com>

git-p4 always fetches the latest revision of UTF16 files from P4 rather than the revision at the commit being sync'd.

The print command should, instead, specify the revision number from the commit in question using the file#revision syntax.

The file#revision syntax is preferable over file@changelist for consistency with how streamP4Files formats the fileArgs list.

Signed-off-by: Daniel Bingham <git@dbingham.com>
---
 git-p4.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/git-p4.py b/git-p4.py
index ff132b2..156f3a4 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2101,7 +2101,8 @@ 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']])
+            ufile = "%s#%s" % (file['depotFile'], file['rev'])
+            text = p4_read_pipe(['print', '-q', '-o', '-', ufile])
             if p4_version_string().find("/NT") >= 0:
                 text = text.replace("\r\n", "\n")
             contents = [ text ]
-- 
2.3.5
Previous: Daniel BinghamNext: Eric Sunshine
Message 2 of 5 in “git-p4: Fetch the proper revision of utf16 files”
  1. git-p4: Fetch the proper revision of utf16 filesDaniel Bingham, Apr 3, 2015
  2. git-p4: Fetch the proper revision of utf16 filesDaniel Bingham, Apr 3, 2015
  3. Eric SunshineApr 3, 2015
  4. Domain AdminApr 3, 2015
  5. Eric SunshineApr 3, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.