git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Bingham <daniel@dbingham.com>
To: git@vger.kernel.org
Cc: luke@diamond.org, pw@padd.com, Daniel Bingham <git@dbingham.com>
Subject: [PATCH] git-p4: Fetch the proper revision of utf16 files
Date: Fri,  3 Apr 2015 14:13:47 -0700	[thread overview]
Message-ID: <1428095627-8772-2-git-send-email-git@dbingham.com> (raw)
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

  reply	other threads:[~2015-04-03 21:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-03 21:13 [PATCH] git-p4: Fetch the proper revision of utf16 files Daniel Bingham
2015-04-03 21:13 ` Daniel Bingham [this message]
2015-04-03 21:46   ` Eric Sunshine
2015-04-03 22:49     ` Domain Admin
     [not found]     ` <CAFzU1R+m8Gw3O_HHKmKq0rTALh+TJ1kK84=L2rsGCNft4XcT=Q@mail.gmail.com>
2015-04-03 22:49       ` Eric Sunshine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1428095627-8772-2-git-send-email-git@dbingham.com \
    --to=daniel@dbingham.com \
    --cc=git@dbingham.com \
    --cc=git@vger.kernel.org \
    --cc=luke@diamond.org \
    --cc=pw@padd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).