Announcement

Collapse
No announcement yet.

BUG: PAGER env variable on Win32 causes a 'p4 resolve' to spawn diffs as merges

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • BUG: PAGER env variable on Win32 causes a 'p4 resolve' to spawn diffs as merges

    Say a person has:

    PAGER=D:\tools\less.exe
    P4DIFF=D:\bc3\bcompare.exe
    P4MERGE=bc3merge.bat

    with bc3merge.bat containing:
    call D:\bc3\bcompare.exe %2 %3 %1 %4 /fv="TextMerge"

    And then the user executes:

    p4 resolve somefile

    And hits 'd' for diff

    This will spawn a BC3 window as a merge rather than a diff, because p4 spawns BC3 like so:

    "D:\bc3\bcomp.exe" "localfile" "perforcefile" "|" "D:\tools\less.exe"

    Can you guys sniff the third param and if it comes in as a pipe treat it as a diff?

    This way I don't have to unset the PAGER every time I want to resolve - diff.

  • #2
    Would it not be easier if you modified your bc3merge.bat?

    Code:
    IF "%3" EQU "|" (
    @REM do one thing
    ) ELSE (
    @REM do something else
    )
    Open up a command prompt and type "if /?" for the full syntax. You may have to play around with the IF statement a little since (not knowing what p4 is) %3 may resolve to nothing and cause a syntax error.

    Good luck,
    Jim

    Comment


    • #3
      Hrm, won't work in bc3merge.bat, but I can create another wrapper for P4DIFF.

      Like:

      call D:\bc3\bcomp.exe %1 %2

      This way when I type:

      p4 resolve somefile

      P4 will output:

      d:\projects\somefile - merging //p4depot/project/somefile#19
      Diff chunks: 1 yours + 1 theirs + 0 both + 0 conflicting
      Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) am:

      Now if I hit 'm'

      It will spawn the P4MERGE script

      If I hit 'd' it'll spawn the 'P4DIFF' script stripping the pipe.

      ...

      So yeah, problem solved.

      Comment

      Working...
      X