Mafia and local SVN repositories?

Razorsoup

Member
Can KoLmafia's SVN capabilities handle checking out a local SVN repository? Or does it have to be hosted on something like sourceforge, google code, etc?
 

fronobulax

Developer
Staff member
I'm gonna say yes. It is nothing more than a SVN client and it doesn't care where the repository is.

I wonder what your use case is? I am well aware of the benefits of running a local SVN repository but in my experience the overhead to setting one up and running it doesn't get worthwhile until there are lots of file to be managed and I am hard pressed to generate that many files in a KoLmafia scripting environment, which is what the back end of the client is expecting to support.
 

roippi

Developer
SVNKit just needs a valid URI. I think I hardwired the SVN command to only accept svn:// and http(s):// URLs but I imagine a valid file:// repo would work. The concept is a bit weird to me (presumably you're running a SVN server locally, so you could just connect via an svn:// URL) but I suppose it would work if file:// was whitelisted to work with SVNCommand too.
 

Razorsoup

Member
Sorry it took so long to respond. School and real life have gotten in the way.
The short version: I have two instances of KoLmafia on this computer and I only want to edit my scripts once. TortoiseSVN allows me to create a serverless SVN repo but I would need KoLmafia to accept a file:// address for that to work. But since there are other solutions and my use case is pretty fringe, it would probably be a waste of dev time to change this. If I really want to use SVN, I can always use Sourceforge or try to setup something like VisualSVN just for the fun of it.
 

lostcalpolydude

Developer
Staff member
SVNKit just needs a valid URI. I think I hardwired the SVN command to only accept svn:// and http(s):// URLs but I imagine a valid file:// repo would work. The concept is a bit weird to me (presumably you're running a SVN server locally, so you could just connect via an svn:// URL) but I suppose it would work if file:// was whitelisted to work with SVNCommand too.

This would give the user (and therefore, a script) access to files outside of mafia's folders, which could theoretically result in messing with system files maybe. It would probably require a bug in the SVN package we imported, but that still seems like enough of a reason to be hesitant even if it was trivial to allow this.
 

fronobulax

Developer
Staff member
Sorry it took so long to respond. School and real life have gotten in the way.
The short version: I have two instances of KoLmafia on this computer and I only want to edit my scripts once. TortoiseSVN allows me to create a serverless SVN repo but I would need KoLmafia to accept a file:// address for that to work. But since there are other solutions and my use case is pretty fringe, it would probably be a waste of dev time to change this. If I really want to use SVN, I can always use Sourceforge or try to setup something like VisualSVN just for the fun of it.

I'm not sure what benefit there is to having multiple independent installations of KoLmafia unless you are trying to run more than two characters at once, but if the goal is to edit a script once and have the edits available at all installations there are several options. Perhaps the easiest would be the symbolic link capability of your OS. One instance has the files and the script directory of every other instance is a symbolic link to that directory. While most synchronization tools are aimed at synching to and from the cloud, they could be tweaked to synch two directories on the same computer. A backup tool can be configured to do the same thing or you could run KoLmafia from a script that you write and have it copy files first. About the only thing that SVN would have given you that this doesn't is the ability to merge and preserve local changes. However, I suspect if your scripts require such changes they could be rewritten to use parameters so that the script was the same everywhere and the parameters (which did change) were in settings or data.
 

Bale

Minion
I'm not sure what benefit there is to having multiple independent installations of KoLmafia unless you are trying to run more than two characters at once.

More than one person playing KoL on the same computer, but wanting to share the scripts that Razorsoup has written. Been there, done that.
 
Last edited:

fronobulax

Developer
Staff member
More than one person playing KoL on the same computer, but wanting to share the scripts that Razorsoup has written. Been there, done that.

Point noted. I spent about 6 years with one installation supporting multiple players on the same computer and that was never an issue for me. Perhaps because it was a Windows box and I am well versed in sharing across multiple Windows user accounts? Regardless once laptops became both necessary for education and comparatively cheap, sharing a computer has been a Thing of the Past in my household.
 

Theraze

Active member
Any chance you can just symlink the svn/script folders? I've done that before when I was maintaining multiple copies of mafia on the same computer...
 
Top