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

[PATCH 2/2] git-p4: handle update of moved files when updating a shelve

From
Luke Diamand <luke@diamand.org>
Date
Jan 13, 2019, 13:58 UTC
Message-ID
<20190113135815.11286-3-luke@diamand.org>
In-Reply-To
<20190113135815.11286-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 were not being added to this list.

Signed-off-by: Luke Diamand <luke@diamand.org>
---
 git-p4.py                | 1 +
 t/t9807-git-p4-submit.sh | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/git-p4.py b/git-p4.py
index 1998c3e141..20c5ce9903 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1875,6 +1875,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 08dc8d2caf..4d5ea9e64c 100755
--- a/t/t9807-git-p4-submit.sh
+++ b/t/t9807-git-p4-submit.sh
@@ -548,7 +548,7 @@ test_expect_success 'submit --update-shelve' '
 	)
 '
 
-test_expect_failure 'update a shelve involving a moved file' '
+test_expect_success 'update a shelve involving a moved file' '
 	test_when_finished cleanup_git &&
 	(
 		cd "$cli" &&
-- 
2.20.1.100.g9ee79a14a8
Previous: Luke DiamandNext: Eric Sunshine
Message 3 of 6 in “git-p4: handle moved files when updating a P4 shelve”
  1. 0/2 git-p4: handle moved files when updating a P4 shelveLuke Diamand, Jan 13, 2019
  2. 1/2 git-p4: add failing test for shelved CL update involving moveLuke Diamand, Jan 13, 2019
  3. 2/2 git-p4: handle update of moved files when updating a shelveLuke Diamand, Jan 13, 2019
  4. Eric SunshineJan 13, 2019
  5. Junio C HamanoJan 14, 2019
  6. Junio C HamanoJan 14, 2019

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.