Author Topic: automated project file adding  (Read 57667 times)

Kung Foo

  • Community Member
  • Posts: 29
  • Hero Points: 0
Re: automated project file adding
« Reply #15 on: June 16, 2008, 05:43:59 AM »
I installed the latest hotfixes for 12.0.3.0, but that did not fix the problem  :-\

I also tried your updated version, and it did not have any effect either (as expected, since there's no specific fixes for this problem).
BTW: There still seems to be the same foreach loop - perhaps I did not get the latest version?

So help is still needed. I'd really like to get this macro to work also with Slickedit 12.0.3.0 version.
« Last Edit: June 30, 2008, 12:21:22 PM by Kung Foo »

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: automated project file adding
« Reply #16 on: June 16, 2008, 09:37:10 AM »
Mumble.
Attached correct one this time (#4 now).

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: automated project file adding
« Reply #17 on: June 25, 2008, 06:47:49 AM »
I can't repro the path problem using the repro steps you provided, but just now I ran into a repro scenario of my own.  I may find time tomorrow to track down what's going on.

Kung Foo

  • Community Member
  • Posts: 29
  • Hero Points: 0
Re: automated project file adding
« Reply #18 on: June 25, 2008, 02:19:03 PM »
Okay. Did you try with 12.0.3.0 or the 2008 version?

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: automated project file adding
« Reply #19 on: June 25, 2008, 06:52:54 PM »
With 12.0.3 r29 and with 3.0.0 rSomethingOrOther and with 3.0.1 r3 -- all no repro using your steps (I replicated the directory tree as given in the first screenshot).

The issue I ran into yesterday was that if you have a trailing file separator (forward or backward slash) at the end of the directory name then it gets quite confused and does weird things to the directory tree structure a little bit similar to the second screen shot you posted.  I fixed that issue; fix is attached.

Kung Foo

  • Community Member
  • Posts: 29
  • Hero Points: 0
Re: automated project file adding
« Reply #20 on: June 28, 2008, 07:22:09 AM »
Thanks, I hope that works ;D
I'll be trying the new version next week when I get back to work..

Kung Foo

  • Community Member
  • Posts: 29
  • Hero Points: 0
Re: automated project file adding
« Reply #21 on: June 30, 2008, 12:20:27 PM »
Sorry to say, but this did not help in my setup. I did not have the file separator (backspace, since I'm in Windows) at the end of my project directory.
I still can reproduce this problem in my setup.

If this helps, I attached the exact file here that I used this time (I only added the project spec).
I don't know what to do now. Could I easily try to debug the script somehow? I'm not really that familiar with the Slicedit macroes..

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: automated project file adding
« Reply #22 on: June 30, 2008, 06:40:09 PM »
I tried with your updated project spec, still no repro (see attached png's to verify the directory structure and completion message).  Each time it gives the same completion message.

You can try "ssync 1" to enable some debugging output, maybe capture the debugging output and paste it here (Ctrl+C in the debug output window copies the entire contents to the clipboard).

Depending on what it shows, perhaps I can enhance certain debugging outputs to help narrow down where things are going awry.
« Last Edit: June 30, 2008, 06:42:43 PM by chrisant »

Kung Foo

  • Community Member
  • Posts: 29
  • Hero Points: 0
Re: automated project file adding
« Reply #23 on: July 02, 2008, 09:42:04 AM »
I tried the debug option, but it just says what's expected: the files that were erroneously removed are reported as removed, and then added erroneously.
I'd have attached a log file here, but the pop-up debug window did not allow copying of the text :(

Anyway, I'm on vacation soon, and debugging can be continued about in a month..

Thanks for the good support, again! I hope we'll get this thing working for me too some day..

Kung Foo

  • Community Member
  • Posts: 29
  • Hero Points: 0
Re: automated project file adding
« Reply #24 on: July 03, 2008, 09:01:26 AM »
I noticed that the path / file name strings are cut starting on 80 characters length.
This got me thinking that I have automatic line length wrap activated just on that length.

Now, when I tried the script without the automatic line length wrap, it started to work OK!

Here's where the line length can be switched:
Tools->Options->File Options->Wrap line length

I think if you put "80" there, you should be able to reproduce the problem.

Now the question is that does the script use temporary file of some sort when comparing the existing directory / file hierarchy to the current one?
If it does, could that be changed somehow, so that using automatic line length wrap would not cause problems?

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: automated project file adding
« Reply #25 on: July 03, 2008, 08:35:28 PM »
Ah!  That's some nice troubleshooting work.  I didn't originally write the macro, I just seem to have de facto taken it over (sorry mikesart!).  I believe it does use a temporary buffer, and probably somehow it is accidentally picking up line wrapping settings.  I hope that line wrapping in general does not typically interfere with hidden buffers (assuming this buffer is hidden, which it might not be), as that could make a lot of macros fragile.

I'll take a look...

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: automated project file adding
« Reply #26 on: July 03, 2008, 09:04:00 PM »
Wait a minute.  It looks like you're setting the global "forcibly wrap long lines" setting.  On my installation it is at the default setting of 4000.

Shouldn't you be using Soft Wrap?  Or normal Word Wrap?  Why are you using the "Wrap line length" setting?

mikesart

  • Community Member
  • Posts: 56
  • Hero Points: 11
Re: automated project file adding
« Reply #27 on: July 03, 2008, 09:49:25 PM »
I didn't originally write the macro, I just seem to have de facto taken it over (sorry mikesart!).

Don't be sorry - I apologize for not being more help here but I'm kind of slammed right now getting a milestone done. So thank you for taking over!

I'm rather interested in hearing how the SE folks handle this option as well cause I think this temp buffer thing I used is rather common. At least I initially got it from the Hurst's book...

Thanks again Chrisant!

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: automated project file adding
« Reply #28 on: July 03, 2008, 10:57:28 PM »
@mikesart:  Cool, keep your eyes on the light at the end of the tunnel!  (It's hardly ever a train).

@Kung Foo:  Here is what's going on:

I think you are probably using the "Wrap line length" option as an easy way to enforce soft wrapping for all file types.  My understanding is that SlickEdit expects you to use the per-language Soft Wrap settings.  From poking around in the SlickEdit Help and in the built in SlickEdit macros (macros\*.e), I think you might find a variety of weird behaviors from using "Wrap line length" the way you're using it.

What is happening is that sync_project_with_scm uses insert_file_list() to add a list of matching files to the temp buffer.  I've added a call to fileman_mode() in sync_project_with_scm before using insert_file_list(), and among other things that successfully disables your "Wrap line length" setting in the temp buffer.  But it appears that most insert_file_list() calls in the built in SlickEdit macros do not call fileman_mode().  So you might see a variety of subtle and weird behaviors from using "Wrap line length" like that; I don't know, I'm only guessing.

Anyway, the attached version should work for you.

Kung Foo

  • Community Member
  • Posts: 29
  • Hero Points: 0
Re: automated project file adding
« Reply #29 on: July 04, 2008, 07:27:54 AM »
Thanks fellows! The new version works just like wanted!

Now that I know about this "hidden feature of SlickEdit", I think I do not dare using the global line wrap feature any more. From now on, I believe I'll stick on using other line wrap mechanisms.

BTW: Some dangerous feature this global line wrap I must say. Nobody can be automatically expected to know about this when writing scripts - IMHO this is quite a trap.

And thanks again for the persistent and quick support!