Mafia SVN for Scripts?

kain

Member
I confess I only went back a couple of pages in the thread to look, but when I did

> svn checkout https://svn.code.sf.net/p/winterbay-mafia/wham/code/

I get:

relay_WHAM_dontuse.ash => C:\Users\na\Dropbox\KM\relay\relay_WHAM_dontuse.ash
WHAM.ash => C:\Users\na\Dropbox\KM\scripts\WHAM.ash


... which is cool, but I already have a WHAM.ash in /scripts/ccs/WHAM.ash

Is there a way to specify the folder you want the SVN to install the script to? I try to keep /scripts/ pretty bare and instead *try* (keyword try) to organize scripts into subfolders.
 

lostcalpolydude

Developer
Staff member
Is there a way to specify the folder you want the SVN to install the script to? I try to keep /scripts/ pretty bare and instead *try* (keyword try) to organize scripts into subfolders.

There's some explanation somewhere in this thread about how that won't be happening. The biggest reason people want that is for an organized Scripts menu, and roippi plans to address that eventually as a separate feature from actual file location in the scripts folder.
 

Winterbay

Active member
As discussed in the BatBrain thread: Is there any way of getting the commit messages since last update to print in the CLI or a popup (controlled y some setting)?
 

roippi

Developer
Yes:

Code:
> svn update

Updating all SVN projects...
bale-relay-woods_getstuff is at HEAD (r5)
Validating repo...
Repo validated.
Updating bumcheekascend-bumcheekascend...
C:\Users\Ben\workspace\kolmafia\svn\bumcheekascend-bumcheekascend
U http://svn.code.sf.net/p/bumcheekascend/code/bumcheekascend/scripts/bumcheekascend.ash
http://svn.code.sf.net/p/bumcheekascend/code/bumcheekascend/scripts
http://svn.code.sf.net/p/bumcheekascend/code/bumcheekascend
At revision 284
Pushing local updates...
bumcheekascend.ash => C:\Users\Ben\workspace\kolmafia\scripts\bumcheekascend.ash
Done.
Update info for bumcheekascend-bumcheekascend:
------
Commit info for r284:
Author: winterbay2

Remove partial removal of workaround for the KoL shop revamp
------
guyymafia-porkfuture is at HEAD (r6)
mafiachit is at HEAD (r22)
mafiasvntest-myvalidproject-beta is at HEAD (r14)
mafiasvntest-myvalidproject1 is at HEAD (r14)
slimetube is at HEAD (r2)
Validating repo...
Repo validated.
Updating winterbay-mafia-autobasement...
C:\Users\Ben\workspace\kolmafia\svn\winterbay-mafia-autobasement
U http://svn.code.sf.net/p/winterbay-mafia/autobasement/code/scripts/autoBasement.ash
http://svn.code.sf.net/p/winterbay-mafia/autobasement/code/scripts
http://svn.code.sf.net/p/winterbay-mafia/autobasement/code
At revision 6
Pushing local updates...
autoBasement.ash => C:\Users\Ben\workspace\kolmafia\scripts\autoBasement.ash
Done.
Update info for winterbay-mafia-autobasement:
------
Commit info for r6:
Author: winterbay2

If max_potion_price is larger than autoBuyPriceLimit, raise the latter to the former (and reset at the end of the script)
Make sure we equip the cached outfits before we do the test for which it is intended
------
winterbay-mafia-wham is at HEAD (r7)
Checking for working copy modifications...
No modifications.
Requests complete.
 
So, not sure if this is a system-Java dependent thing (probably...) but when I checkedout my bot the dialogue box regarding overriding local files was... quite large. It extended beyond the bottom of my screen, and I couldn't see the options (and if I hadn't done it before, I wouldn't have known what the prompt was). Hoping that the default was "OK" and not "Cancel" I pressed enter and everything worked as planned.
Not sure if this is really worth the time to fix, since I don't think it's very often that people will be checking out mega-scripts that they already have all the files for, but... just thought y'all should know.

Windows 7, r12167, JRE v1.7.0_10-b18
 

roippi

Developer
So, not sure if this is a system-Java dependent thing (probably...) but when I checkedout my bot the dialogue box regarding overriding local files was... quite large. It extended beyond the bottom of my screen, and I couldn't see the options (and if I hadn't done it before, I wouldn't have known what the prompt was). Hoping that the default was "OK" and not "Cancel" I pressed enter and everything worked as planned.
Not sure if this is really worth the time to fix, since I don't think it's very often that people will be checking out mega-scripts that they already have all the files for, but... just thought y'all should know.

Windows 7, r12167, JRE v1.7.0_10-b18

Yeah, I should stick the dialog contents into a scrollPane so that doesn't happen for mega-checkouts.
 

Veracity

Developer
Staff member
When I check out a project, I get lots of output on the terminal window where I started KoLmafia. Is this what you are talking about?
 

Winterbay

Active member
When I check out a project, I get lots of output on the terminal window where I started KoLmafia. Is this what you are talking about?

No, I think it was the information given as a popup when something you check out decides to add a new file or overwrite old ones.
 

roippi

Developer
No, I think it was the information given as a popup when something you check out decides to add a new file or overwrite old ones.

Checkout only gives that popup when overwriting old files, it assumes you're okay with installing new files when you issue a checkout command. Since, like, that's the point.

I should probably suppress that terminal output that V is talking about though.
 

Theraze

Active member
Yes:

Code:
> svn update

Updating all SVN projects...
bale-relay-woods_getstuff is at HEAD (r5)
Validating repo...
Repo validated.
Updating bumcheekascend-bumcheekascend...
C:\Users\Ben\workspace\kolmafia\svn\bumcheekascend-bumcheekascend
U http://svn.code.sf.net/p/bumcheekascend/code/bumcheekascend/scripts/bumcheekascend.ash
http://svn.code.sf.net/p/bumcheekascend/code/bumcheekascend/scripts
http://svn.code.sf.net/p/bumcheekascend/code/bumcheekascend
At revision 284
Pushing local updates...
bumcheekascend.ash => C:\Users\Ben\workspace\kolmafia\scripts\bumcheekascend.ash
Done.
Update info for bumcheekascend-bumcheekascend:
------
Commit info for r284:
Author: winterbay2

Remove partial removal of workaround for the KoL shop revamp
------
guyymafia-porkfuture is at HEAD (r6)
mafiachit is at HEAD (r22)
mafiasvntest-myvalidproject-beta is at HEAD (r14)
mafiasvntest-myvalidproject1 is at HEAD (r14)
slimetube is at HEAD (r2)
Validating repo...
Repo validated.
Updating winterbay-mafia-autobasement...
C:\Users\Ben\workspace\kolmafia\svn\winterbay-mafia-autobasement
U http://svn.code.sf.net/p/winterbay-mafia/autobasement/code/scripts/autoBasement.ash
http://svn.code.sf.net/p/winterbay-mafia/autobasement/code/scripts
http://svn.code.sf.net/p/winterbay-mafia/autobasement/code
At revision 6
Pushing local updates...
autoBasement.ash => C:\Users\Ben\workspace\kolmafia\scripts\autoBasement.ash
Done.
Update info for winterbay-mafia-autobasement:
------
Commit info for r6:
Author: winterbay2

If max_potion_price is larger than autoBuyPriceLimit, raise the latter to the former (and reset at the end of the script)
Make sure we equip the cached outfits before we do the test for which it is intended
------
winterbay-mafia-wham is at HEAD (r7)
Checking for working copy modifications...
No modifications.
Requests complete.

Since it's not entirely clear... does this display only the most recent commit message or does it display all between the current revision and head?
 

roippi

Developer
The latter. Or even:

Code:
> svn dec wham

Decrementing project winterbay-mafia-wham from r7 to r6
C:\Users\Ben\workspace\kolmafia\svn\winterbay-mafia-wham
U https://svn.code.sf.net/p/winterbay-mafia/wham/code/scripts/WHAM.ash
https://svn.code.sf.net/p/winterbay-mafia/wham/code/scripts
https://svn.code.sf.net/p/winterbay-mafia/wham/code
At revision 6
Pushing local updates...
WHAM.ash => C:\Users\Ben\workspace\kolmafia\scripts\WHAM.ash
Done.
Update info for winterbay-mafia-wham:
------
Commit r6:
Author: winterbay2

Fix Basement detection, thanks Bale for the idea
------

i.e. display info from a to b, not including a.
 

roippi

Developer
So I was thinking

We now enforce script namespace uniqueness. That's cool. It also implies that we have a function to search the namespace and return all matches.

Right now, when you move the local copy of an svn-installed script, the link between svn and your local copy is broken. Though updates will continue to happen to your working copy, that marooned local copy won't be touched. As far as svn knows, you deleted the file.

How about instead, when we don't see the local copy in the default place, we perform the same namespace search that occurs when calling a script. If we find a unique match, overwrite that file.

I don't see too much downside to doing this. It is a quick fix that lets people restructure their scripts folder to soothe the OCD demons. I still plan on revamping the scripts menu but that's a sizable project that I may not get to for months. This, I could code in about three minutes.
 

Bale

Minion
I think that is an incredibly helpful feature! Please make it happen. It will hold me over beautifully until you get around to the menu revamp.

I assume it will happen on checkout also, so if I have a pre-SVN copy of WHAM, my checkout will find it and overwrite it in its subdirectory.
 

roippi

Developer
Checkout works a little differently under the hood so that's basically a separate fix, though yes it logically follows from the first thing.
 

Ethelred

Member
So I was thinking

...

when we don't see the local copy in the default place, we perform the same namespace search that occurs when calling a script. If we find a unique match, overwrite that file.

I don't see too much downside to doing this. It is a quick fix that lets people restructure their scripts folder to soothe the OCD demons. I still plan on revamping the scripts menu but that's a sizable project that I may not get to for months. This, I could code in about three minutes.

This sounds like a great idea. The inability to organize my scripts menu the way I want was a serious downside to the whole mafia scripts SVN change, as far as I was concerned. Please add this feature.
 

zarqon

Well-known member
Yes. I almost never call scripts from my scripts menu but when I do I enjoy being able to swiftly locate them based on orderly categories.

If you implement this, the other planned menu feature could be back burnered or even forgotten, methinks.
 

Winterbay

Active member
I too support this possible change. It would be great to avoid that "script-menu-getting-way-too-long" problem.
 

roippi

Developer
k, r12218. Note that "svn delete" works the same way; it will rapaciously seek out and delete (unique) local files named the same thing as the project files you're trying to uninstall. That makes me a little uncomfortable and I may roll that part of it back depending on feedback.
 

Winterbay

Active member
If you have two SVN-repositories of similar names (substrings of each other) and try to do "svn update <proj name>" you get an error:
Code:
    [COLOR=olive]> svn update winterbay-mafia-wham[/COLOR]

winterbay-mafia-wham
winterbay-mafia-wham-beta

[COLOR=red][winterbay-mafia-wham]      has too many matches.
[/COLOR]

How would I call to update the first one when it fuzzy matches against the second as well?
 
Top