Author Topic: Linux 21.0.1.0 and Perforce History glitches  (Read 2191 times)

mrothman

  • Senior Community Member
  • Posts: 117
  • Hero Points: 1
Linux 21.0.1.0 and Perforce History glitches
« on: December 14, 2016, 07:31:31 pm »
I just downloaded 21.0.1.0, 64 bit on Linux, upgrading from SlickEdit 18.  It found all my old projects, and things mostly look good.  But when I use the Perforce History dialog on a file, it does some unexpected things:
  • It jumps immediately into a diff between the file on disk and the most recent version in source control.  Granted, that's often what I want to do, but still...
  • If I close that diff, and then try to run a diff by selecting a version from the dialog and pushing "Diff", it gives me a dialog which complains that the encoding of the temporary file it's creating is different from the encoding of my source file. Specifically that the /tmp/<number> file is a unicode file and the source file is not, will I please tell it the Unicode encoding of the file.  Since I didn't even create the file which it is saying is unicode, that seems odd.
  • As I am looking at that dialog, suddenly a "Save Deleted Files" dialog pops up, offering to save the "deleted" source file.  Which of course I haven't deleted.  I hurriedly back out of there with a Cancel, and that's where I am at the moment.

I've looked through the configuration and haven't found anything obvious to tweak.  There may be some issue with having leaped over so many versions at once of course.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2049
  • Hero Points: 98
Re: Linux 21.0.1.0 and Perforce History glitches
« Reply #1 on: December 14, 2016, 07:38:54 pm »
I think you must be using "History Diff on <file>", not "History on <file>", right?

mrothman

  • Senior Community Member
  • Posts: 117
  • Hero Points: 1
Re: Linux 21.0.1.0 and Perforce History glitches
« Reply #2 on: December 14, 2016, 07:55:16 pm »
No, it's the "History for <file>".  I tried out the History Diff however, and it is kind of cool - either that wasn't in 18 or I missed it.  The GUI I'm seeing for "History for" seems exactly the same as I'm used to, except of course that it goes straight into a diff.  But the GUI of the diff looks just like what I would expect if I had gotten the History dialog from SlickEdit 18 and then asked for a diff.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2049
  • Hero Points: 98
Re: Linux 21.0.1.0 and Perforce History glitches
« Reply #3 on: December 14, 2016, 07:59:11 pm »
I think history diff was introduced in v19, but I'm not entirely sure.

Let me look into your problem.  I just tested with Perforce and didn't see this, so I may have to try it on Linux... which means I will have to install it on Linux.

mrothman

  • Senior Community Member
  • Posts: 117
  • Hero Points: 1
Re: Linux 21.0.1.0 and Perforce History glitches
« Reply #4 on: December 14, 2016, 07:59:56 pm »
Thanks Dan. I'm going to go try a few other projects just for grins.  Who knows, maybe something odd in this one.

mrothman

  • Senior Community Member
  • Posts: 117
  • Hero Points: 1
Re: Linux 21.0.1.0 and Perforce History glitches
« Reply #5 on: December 14, 2016, 08:15:12 pm »
Clues?:
- The problem does not occur if the file in the buffer is not checked out for editing (I just get the normal History dialog).
- The problem does not occur if the file is checked out but hasn't been changed.
- The problem does not occur if the file is changed to be writeable, changed, but not checked out.
So it seems it's necessary that it be both checked out and changed for the problem to occur.
Also, it does not seem that it's a function of something in my old projects per se, since I can create a new project and have the same problem.  However, I did see one case where despite the fact that the file was checked out and had been changed, the problem did not occur.  Trying to see if I can see anything different about that case.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2049
  • Hero Points: 98
Re: Linux 21.0.1.0 and Perforce History glitches
« Reply #6 on: December 14, 2016, 08:26:00 pm »
OK.  Thank you for the specifics (they always help).

I still can't get it on Windows.  Let me install Perforce on Linux and see what happens.

mrothman

  • Senior Community Member
  • Posts: 117
  • Hero Points: 1
Re: Linux 21.0.1.0 and Perforce History glitches
« Reply #7 on: December 15, 2016, 08:16:07 pm »
Hi Dan. Today the second part of the problem has disappeared.  That is, while it still creates an unexpected diff when I am simply trying to get the File History dialog, it does not complain about unicode not matching on subsequent diffs.  I have no idea what changed - I did little or nothing in SlickEdit yesterday after corresponding here.

Perhaps tomorrow the diffs will be gone also  ;D

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2049
  • Hero Points: 98
Re: Linux 21.0.1.0 and Perforce History glitches
« Reply #8 on: December 15, 2016, 08:18:58 pm »
Perhaps tomorrow the diffs will be gone also  ;D

I'll probably still be trying to setup Perforce on Linux ;).

I have it setup on Windows, and no matter what I did I couldn't get Linux to play nice with the server on my Windows box. So am just getting it setup on Linux.

Regarding the Unicode issue, did you do a different file?

Did you launch the editor differently?

mrothman

  • Senior Community Member
  • Posts: 117
  • Hero Points: 1
Re: Linux 21.0.1.0 and Perforce History glitches
« Reply #9 on: December 15, 2016, 08:25:39 pm »
I tried to do the same files I did before - I can't be absolutely sure, but by working my way backwards through my current projects (I have 4), I can try on all 2 dozen or so files which are checked out.  I'll do that now.
I started the editor exactly the same way - which is directly from a terminal window (in fact the same terminal window), because I haven't gotten around to creating a launcher icon for the new version yet.

That makes me remember one thing however - I DID launch SlickEdit 2013 one time yesterday after the initial use of 2016.  The new and old version are NOT pointing at the same config directory, but they do share the same projects, so I suppose it's possible that the projects were touched.  Darned if I can see how that would have undone the encoding complaint - it appeared the complain was about the temp file being created in order to do the compare, so that shouldn't even exist outside of that comparison.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2049
  • Hero Points: 98
Re: Linux 21.0.1.0 and Perforce History glitches
« Reply #10 on: December 15, 2016, 08:29:09 pm »
I don't think that's it (the projects).

Here's a quick way to see what you edited (if your "root" isn't too "deep"):
  • On the SlickEdit command line (click at the bottom of the editor) type "list <path>"
  • After the list comes up, on the SlickEdit command line type "fsort d"
The files at the bottom are the ones you edited most recently.  Pressing Enter on one will open it.

mrothman

  • Senior Community Member
  • Posts: 117
  • Hero Points: 1
Re: Linux 21.0.1.0 and Perforce History glitches
« Reply #11 on: December 15, 2016, 08:48:23 pm »
Dan, I got it (or at least I got the proximate cause).  I'll post another reply shortly - just didn't want you to keep struggling with Perforce.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2049
  • Hero Points: 98
Re: Linux 21.0.1.0 and Perforce History glitches
« Reply #12 on: December 15, 2016, 08:49:27 pm »
Of the diff issue?

mrothman

  • Senior Community Member
  • Posts: 117
  • Hero Points: 1
Re: Linux 21.0.1.0 and Perforce History glitches
« Reply #13 on: December 15, 2016, 09:12:36 pm »
Of both it seems.  And you may still have to set up Perforce on Linux, but not with much urgency.

OK, Perforce has an option to set an environment variable P4DIFF to some editor if you want it to use that editor for its commands (such as p4 client) which bring up a file or configuration for editing.  With my multi-decade loyalty to SlickEdit, I of course set it to the path to SlickEdit 18.  When I removed that variable, the problem went away.  (I removed P4MERGE for good measure, but I doubt that was relevant.

Why doing the history should access that variable and do a diff based on it - I have no idea.  After I removed the variable, it doesn't bring up any alternate "default" diff instead (which is what you would think would happen if it is somehow calling on perforce to do a diff).

Then I tried putting back the variable, and this time having it point to the new installation (because of course it had been pointing at SlickEdit 18, not 21).  Immediately the encoding complaint came back: and the ordering is a little different - it complains first about the encoding, and if I then click on "OK" it does the diff.  Hmmm.  So I went back to the original value for the P4DIFF (SlickEdit 18), and now the encoding complaint is gone (as it has been today), but the diff comes up.

So, what do we know? (Not much).  Somehow having the environment variable set leads to the invocation of the diff, presumably of the diff specified in the environment variable.  I tried one more thing, which was to run the perforce command at the prompt of the terminal I've been using to run SlickEdit (to make sure the environment was the same).  The command I ran was:

p4 filelog <name of one of the files having the problem>

I'm guessing that's the command line equivalent to what SlickEdit does to get the file history.  I hoped it would do something odd like bring up a diff, but nope - just listed the revisions of the file correctly.

The good news is that I can easily exclude the setting of these variables when SlickEdit is coming up because normally it has a non-interactive shell all to itself that starts it, and I already do a few things differently in the .cshrc file for that.  In fact, now I'm wondering whether something I'm doing in the .cshrc file was counteracting the problem for 18 (which I start up from a panel button).  Maybe I'm seeing the problem now because I am bringing up SlickEdit directly in a regular terminal.  I'll test that next.

mrothman

  • Senior Community Member
  • Posts: 117
  • Hero Points: 1
Re: Linux 21.0.1.0 and Perforce History glitches
« Reply #14 on: December 15, 2016, 09:15:26 pm »
I'm sorry, slight mistatement in the above.  The P4DIFF variable is set to SlickEdit's diff (obviously), not general editing.  And it's used by perforce for p4 commands which would create a diff (duh).

SlickEdit's integration with Perforce is good enough that I almost never use such commands at the command line anyway, another reason I don't really need that environment variable.