Skip to content

Commit

Permalink
git-p4: add RCS keyword status message
Browse files Browse the repository at this point in the history
During the p4 submit process, git-p4 will attempt to apply a patch
to the files found in the p4 workspace. However, if 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 the re-apply attempt 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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
seraphire authored and gitster committed Feb 14, 2020
1 parent 38ecf75 commit 1ec4a0a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions git-p4.py
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 1ec4a0a

Please sign in to comment.