Skip to content

Ignore P4DIFF and DIFF in p4-revert#240

Open
alexhutcheson wants to merge 1 commit intogareth-rees:masterfrom
alexhutcheson:fix-p4-revert
Open

Ignore P4DIFF and DIFF in p4-revert#240
alexhutcheson wants to merge 1 commit intogareth-rees:masterfrom
alexhutcheson:fix-p4-revert

Conversation

@alexhutcheson
Copy link

@alexhutcheson alexhutcheson commented Nov 29, 2017

p4-revert runs 'p4 diff' and expects a textual diff response. This
assumption is violated if P4DIFF points to a graphical diff tool, which
may not return a textual diff. The same behavior happens if P4DIFF is not
set and DIFF points to a graphical diff tool, since p4 falls back to using
DIFF.

We fix this by clearing the P4DIFF and DIFF variables from the local
environment before running 'p4 diff'. This behavior change only applies
to the p4-revert function.

Fixes #239

p4-revert runs 'p4 diff' and expects a textual diff response. This
assumption is violated if P4DIFF points to a graphical diff tool, which
may not return a textual diff. The same behavior happens if P4DIFF is not
set and DIFF points to a graphical diff tool, since p4 falls back to using
DIFF.

We fix this by clearing the P4DIFF and DIFF variables from the local
environment before running 'p4 diff'. This behavior change only applies
to the p4-revert function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

p4-revert behaves poorly when P4DIFF is set to a graphical diff tool

1 participant