[v4,6/6] git-4: add RCS keyword status message
diff mbox series

Message ID b92e017cb166c81f4675dbe65e0eba57ab1af1a8.1581372376.git.gitgitgadget@gmail.com
State New
Headers show
Series
  • git-p4: add hooks for p4-changelist
Related show

Commit Message

Philippe Blain via GitGitGadget Feb. 10, 2020, 10:06 p.m. UTC
From: Ben Keene <seraphire@gmail.com>

During the p4 submit process, git-p4 will attempt to apply a patch
to the files found in the p4 workspace. However, it P4 uses RCS
keyword expansion, this patch may fail.

When the patch fails, the user is alerted to the failure and that git-p4
will attempt to clear the expanded text from the files and re-apply
the patch. The current version of git-p4 does not tell the user the
result of applying the patch after the RCS expansion has been removed
which can be confusing.

Add a new print statement after the git patch has been successfully
applied when the RCS keywords have been cleansed.

Signed-off-by: Ben Keene <seraphire@gmail.com>
---
 git-p4.py | 4 ++++
 1 file changed, 4 insertions(+)

Patch
diff mbox series

diff --git a/git-p4.py b/git-p4.py
index 4b77879679..1c9c5270b2 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2025,6 +2025,9 @@  def applyCommit(self, id):
         applyPatchCmd = patchcmd + "--check --apply -"
         patch_succeeded = True
 
+        if verbose:
+            print("TryPatch: %s" % tryPatchCmd)
+
         if os.system(tryPatchCmd) != 0:
             fixed_rcs_keywords = False
             patch_succeeded = False
@@ -2064,6 +2067,7 @@  def applyCommit(self, id):
                 print("Retrying the patch with RCS keywords cleaned up")
                 if os.system(tryPatchCmd) == 0:
                     patch_succeeded = True
+                    print("Patch succeesed this time with RCS keywords cleaned")
 
         if not patch_succeeded:
             for f in editedFiles: