Author Topic: Beta 2 - Perforce diff against latest doesn't work.  (Read 2405 times)

sndom

  • Community Member
  • Posts: 70
  • Hero Points: 1
Beta 2 - Perforce diff against latest doesn't work.
« on: May 07, 2013, 11:39:20 am »
This may be the same issue as http://community.slickedit.com/index.php/topic,8987.0.html, but with Perforce.

Using the right click context menu, "Version Control->Diff <file> with the most up to date version" yields a diff against what seems to be the last version in SE's history of the file, NOT against the most recent version in perforce.

The diff indicates the correct perforce file name and version, but the content against which it has diff'd is the previous saved version of the file.

Cheers
Dom

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1832
  • Hero Points: 74
Re: Beta 2 - Perforce diff against latest doesn't work.
« Reply #1 on: May 07, 2013, 12:40:35 pm »
Thanks for the heads up.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1832
  • Hero Points: 74
Re: Beta 2 - Perforce diff against latest doesn't work.
« Reply #2 on: May 07, 2013, 12:51:24 pm »
So you're saying it always diffs against the version that you currently have checked out?  Because in my tests it seems to be getting the head version.  Could there be a configuration option for this that you have set in Perforce?

sndom

  • Community Member
  • Posts: 70
  • Hero Points: 1
Re: Beta 2 - Perforce diff against latest doesn't work.
« Reply #3 on: May 07, 2013, 01:33:00 pm »
Having just tried to reproduce this again, I think the problem may be more subtle.

Check out a file to edit.
Make changes to the file in two places.
Save the file.
Invoke "Version Control->Diff <file> with the most up to date version".
The left most pane of the diff now shows my modified file (correctly).
The right pane describes itself as the correct file and revision in perforce (something like: //depot/test/file.h#5), but the content of the buffer is incorrect.  The diff shows the first of my two changes, but indicates that the second change already exists in the file in perforce. 
Clicking "Next Diff" says "No more differences".

Then:

Close the diff.
Make another change to the file above both previous changes.
Invoke the diff again.
The diff now shows only this latest change, with the "perforce" file being shown as already containing the two previous changes.

So it seems that the diff is only showing the first change in a file, after which the file from version control is incorrectly displayed as being identical to the modified one.

Dom

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1832
  • Hero Points: 74
Re: Beta 2 - Perforce diff against latest doesn't work.
« Reply #4 on: May 07, 2013, 01:35:08 pm »
Are you comparing an unsaved buffer?  I think that would cause the behavior you're explaining.  I had to handle this case for Subversion, but I just realized I haven't yet for Perforce.

sndom

  • Community Member
  • Posts: 70
  • Hero Points: 1
Re: Beta 2 - Perforce diff against latest doesn't work.
« Reply #5 on: May 07, 2013, 02:17:05 pm »
With saved files.

The effects I see seem to vary each time I try it.  Sometimes it works.  Sometimes it finds some but not all of the differences.  Sometimes it shows that there is a difference, but incorrectly highlights it in the diff view.  The results seem to be consistent for a given set of changes to the modified file - that is to say that repeatedly invoking the diff produces the same result.

Once I have a modified version of the file that produces a broken diff, editing the file below the point at which the diff broke does not appear to change the result.  Editing the file above the first broken diff does change the results.

If I had to guess, I would say that it is the diff generator that is broken.

Dom

sndom

  • Community Member
  • Posts: 70
  • Hero Points: 1
Re: Beta 2 - Perforce diff against latest doesn't work.
« Reply #6 on: May 07, 2013, 02:25:14 pm »
It has now hung with one thread running flat out when invoking the diff.
Is here a secure way to send you a dump file?

Dom

sndom

  • Community Member
  • Posts: 70
  • Hero Points: 1
Re: Beta 2 - Perforce diff against latest doesn't work.
« Reply #7 on: May 07, 2013, 02:37:22 pm »
The hang is reproducible with this set of inputs after I restart SE.

Diff'ing (with Tools->File Difference...) the buffer against a file elsewhere on the disk containing an identical file to the one in perforce produces the correct result and does not hang.

Dom

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1832
  • Hero Points: 74
Re: Beta 2 - Perforce diff against latest doesn't work.
« Reply #8 on: May 07, 2013, 02:39:57 pm »
Is there any chance you can send me the files?

sndom

  • Community Member
  • Posts: 70
  • Hero Points: 1
Re: Beta 2 - Perforce diff against latest doesn't work.
« Reply #9 on: May 07, 2013, 02:52:57 pm »
On their way to your email...

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1832
  • Hero Points: 74
Re: Beta 2 - Perforce diff against latest doesn't work.
« Reply #10 on: May 07, 2013, 08:18:54 pm »
The files you emailed me were a "bad case" so it was a slow diff, but it did complete.  If you give it some time (it took about 9-10 seconds on my machine), does it finish?

sndom

  • Community Member
  • Posts: 70
  • Hero Points: 1
Re: Beta 2 - Perforce diff against latest doesn't work.
« Reply #11 on: May 08, 2013, 12:04:38 pm »
The diff hadn't produced anything after 5 over minutes.

Diff'ing the same content directly with SE by way of "Tools->File difference..." or other diff tools such as Araxis is essentially instantaneous so this path must be doing something different.

Dom

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1832
  • Hero Points: 74
Re: Beta 2 - Perforce diff against latest doesn't work.
« Reply #12 on: May 08, 2013, 04:15:49 pm »
OK.  I had tried to design things so that diff used the output from Perforce's diff command (as opposed to getting the appropriate version of the file and running our diff).  I am going to change this for beta 3.

Tim Kemp

  • Senior Community Member
  • Posts: 513
  • Hero Points: 83
Re: Beta 2 - Perforce diff against latest doesn't work.
« Reply #13 on: May 15, 2013, 02:08:11 pm »
I just installed Beta 3. I have several files checked out and modified in Perforce. When I do a difference one of the files tells me that it is opened for Add. The others tell me that they aren't changed. When I diff the same files in P4V it works fine.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1832
  • Hero Points: 74
Re: Beta 2 - Perforce diff against latest doesn't work.
« Reply #14 on: May 15, 2013, 02:09:11 pm »
How did you do the diff?  Can you give me a little more information where you started and what you ran?