git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Luke Diamand <luke@diamand.org>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Andrew Oakley" <aoakley@roku.com>,
	"Romain Merland" <merlorom@yahoo.fr>,
	"SZEDER Gábor" <szeder.dev@gmail.com>,
	"Vitor Antunes" <vitor.hda@gmail.com>,
	"Andrey Mazo" <amazo@checkvideo.com>,
	"Luke Diamand" <luke@diamand.org>
Subject: [PATCHv3 2/2] git-p4: handle update of moved/copied files when updating a shelve
Date: Fri, 18 Jan 2019 09:36:56 +0000	[thread overview]
Message-ID: <20190118093656.16521-3-luke@diamand.org> (raw)
In-Reply-To: <20190118093656.16521-2-luke@diamand.org>

Perforce requires a complete list of files being operated on. If
git is updating an existing shelved changelist, then any files
which are moved or copied were not being added to this list.

Signed-off-by: Luke Diamand <luke@diamand.org>
Acked-by: Andrey Mazo <amazo@checkvideo.com>
---
 git-p4.py                | 2 ++
 t/t9807-git-p4-submit.sh | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/git-p4.py b/git-p4.py
index 1998c3e141..b1c262e13d 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1859,6 +1859,7 @@ def applyCommit(self, id):
                     filesToAdd.remove(path)
             elif modifier == "C":
                 src, dest = diff['src'], diff['dst']
+                all_files.append(dest)
                 p4_integrate(src, dest)
                 pureRenameCopy.add(dest)
                 if diff['src_sha1'] != diff['dst_sha1']:
@@ -1875,6 +1876,7 @@ def applyCommit(self, id):
                 editedFiles.add(dest)
             elif modifier == "R":
                 src, dest = diff['src'], diff['dst']
+                all_files.append(dest)
                 if self.p4HasMoveCommand:
                     p4_edit(src)        # src must be open before move
                     p4_move(src, dest)  # opens for (move/delete, move/add)
diff --git a/t/t9807-git-p4-submit.sh b/t/t9807-git-p4-submit.sh
index 2ad3d801cc..099e5e079d 100755
--- a/t/t9807-git-p4-submit.sh
+++ b/t/t9807-git-p4-submit.sh
@@ -546,7 +546,7 @@ test_expect_success 'submit --update-shelve' '
 	)
 '
 
-test_expect_failure 'update a shelve involving moved and copied files' '
+test_expect_success 'update a shelve involving moved and copied files' '
 	test_when_finished cleanup_git &&
 	(
 		cd "$cli" &&
-- 
2.20.1.100.g9ee79a14a8


  reply	other threads:[~2019-01-18  9:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18  9:36 [PATCHv3 0/2] git-p4: shelved change update with move/copy Luke Diamand
2019-01-18  9:36 ` [PATCHv3 1/2] git-p4: add failing test for shelved CL update involving move/copy Luke Diamand
2019-01-18  9:36   ` Luke Diamand [this message]
2019-01-18 17:46 ` [PATCHv3 0/2] git-p4: shelved change update with move/copy Junio C Hamano
2019-01-22 18:16 ` Mazo, Andrey

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20190118093656.16521-3-luke@diamand.org \
    --to=luke@diamand.org \
    --cc=amazo@checkvideo.com \
    --cc=aoakley@roku.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=merlorom@yahoo.fr \
    --cc=szeder.dev@gmail.com \
    --cc=vitor.hda@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).