Page 2 of 2 FirstFirst 1 2
Results 11 to 20 of 20

Thread: quick SVN primer (for scripters)

  1. #11
    Developer
    Join Date
    Nov 2008
    Location
    Paris, France
    Posts
    4,511

    Default

    I finally migrated a script to SVN, and I hit a couple of bumps I wanted to mention here:

    Click OK and you should get a new working copy of your repo! Cool. Open it up and let's add some stuff. Add a new directory (call it whatever), within that directory add a folder called scripts/, and within scripts/ put a new text file.
    Originally Posted by roippi View Post
    Apparently the scripts/ folder has to be at the root. Putting it inside another directory led to the error "The requested repo failed validation. Complain to the script's author."

    I think you should mention how dependencies.txt works too. It has to be at the root too (next to the scripts/ folder), and it should only contain the checkout URLs of the dependency projects, like this:
    Code:
    https://svn.code.sf.net/p/zlib/code
    https://svn.code.sf.net/p/slyz-nemesis/code/
    One last (very small) inconvenience was that I discovered after installing TortoiseSVN 1.8 that SVN 1.8 isn't backwards compatible. Mafia uses SVN 1.7, so you can't use TortoiseSVN 1.8 on Mafia's checked out copy of your script (the one in svn/).

    The workaround is either (a) install TortoiseSVN 1.7 or (b) check out a separate copy of your project that you use for commits.
    Last edited by slyz; 11-07-2013 at 09:44 PM.
    Try the Nemesis Quest Script or the FamiliarFeeder interface.
    *shakes KoLMafia tech support magic 8-ball* Update mafia to the latest daily .JAR!
    NEW Dad ASCENSION STARTED 20120730
    ------------------------------
    Welcome to Parenthood, Noob

  2. #12
    Developer roippi's Avatar
    Join Date
    Aug 2010
    Posts
    2,663

    Default

    Apparently the scripts/ folder has to be at the root.
    Originally Posted by slyz View Post
    Not at the root of your repo, just at the root of the directory that you specify to checkout. You could have a project like

    Code:
    https://svn.code.sf.net/p/my_project/folder1/folder2/folder3/scripts
    And as long as you specify that the url to check out is https://svn.code.sf.net/p/my_project/folder1/folder2/folder3/ it will pass validation.

    I'm aware of the issue with SVN 1.8 and it frustrates me greatly. I think I might just upgrade the SVNkit sources, but I think that will make 1.7 clients unusable. It's a mess.

  3. #13
    Developer roippi's Avatar
    Join Date
    Aug 2010
    Posts
    2,663

    Default

    Actually it looks like svnkit doesn't yet have a stable version that supports 1.8, so I won't be doing that until they do.

  4. #14
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    D.C. suburbs of Virginia, USA
    Posts
    3,684

    Default

    Depending upon which computer I have 1.6, 1.7 and 1.8 repositories. It is a PITA but an unfortunate consequence of IDEs that don't stay up to date and licenses that only apply to my work computer.

    I updated DCQuest by copying the appropriate KoL svn directory elsewhere, updating just the DCQuest svn to 1.8, doing my commit from that with a 1.8 client and then replacing the upgraded directory with the 1.7 copy that had been squirreled away.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post
    There are 69 players more powerful than you.
    Originally Posted by Statistics Leaderboards

  5. #15

    Default

    First, get a sourceforge account. Make a new project there. Download TortoiseSVN and install it. Make a new folder somewhere on your computer. Right-click, and choose SVN Checkout... from the context menu. You will want to give it the address that you see on your new sourceforge project code page - for now just grab the http:// address, it's easier. Ignore the commands in front of the address and after it, those are for command-line svn tools.

    The rest of the default options are okay. Click OK and you should get a new working copy of your repo! Cool.
    Originally Posted by roippi View Post
    Hey, I'm trying to get my first script here set up with SVN, and so far I'm not having luck. I'm not sure I'm doing the "Make a new project there" step right. Does any one have more info? Also, it doesn't seem to be easy to change the initial settings from when I created a project or to delete a sourceforge project, and at this point I feel like I'm spamming them with new projects as I try to figure out the correct settings, so I figured it was time to ask.

    Attempt 1: Project name CartoucheHunter
    On the "Create Your Project Now" page, I saw an SVN checkbox and figured that had to be a good thing to check. I was able to use TortoiseSVN SVN Checkout to get my ash file into the sourceforge project, but when I tried to run "svn checkout https://svn.code.sf.net/p/cartouchehunter/svn/" in mafia, it said "The requested repo failed validation. Complain to the script's author." At that point, I noticed my https:// address is /svn instead of /code, which doesn't match the rest of the scripts here.

    Attempt 2: Project name KoL_CartoucheHunter
    I tried creating a new project without "SVN" checked. This one seemed better at first since there was a "Code" tab. However, when I tried to use TortoiseSVN to "Right click->SVN Checkout" on a new folder on my PC, after entering my sourceforge login, it gives an error: "Unable to connect to a repository at URL 'https:[email protected]/p/kolcartouchehunter/code' 'p/kolcartouchehunter/code' path not found"
    Poking around these forums, I saw Bale said "git is not an option for KoLmafia. It can only handle SVN". So I checked and saw that the "Git" checkbox is checked by default when creating a sourceforge project.

    Attempt 3: Project name LoathingCartoucheHunter
    I unchecked "Git" on the project creation page. Well crap, the resulting project doesn't have a "Code" tab.

    Any thoughts?
    Last edited by ungawa; 03-29-2015 at 02:29 PM.

  6. #16
    Senior Member
    Join Date
    Apr 2009
    Posts
    1,656

    Default

    Attempt 1: Project name CartoucheHunter
    On the "Create Your Project Now" page, I saw an SVN checkbox and figured that had to be a good thing to check. I was able to use TortoiseSVN SVN Checkout to get my ash file into the sourceforge project, but when I tried to run "svn checkout https://svn.code.sf.net/p/cartouchehunter/svn/" in mafia, it said "The requested repo failed validation. Complain to the script's author." At that point, I noticed my https:// address is /svn instead of /code, which doesn't match the rest of the scripts here.
    Originally Posted by ungawa View Post
    I think this looks best of the three, but ...
    1) https://svn.code.sf.net/p/cartouchehunter/svn/ contains one directory, and that directory is not scripts/; it should contain scripts/ directly and not in a subdirectory.
    Alternatively, your checkou should be from "https://svn.code.sf.net/p/cartouchehunter/svn/ cartouchehunter-svn/", which leads to
    2) the name of that directory, " cartouchehunter-svn/", starts with a space. Don't do that. Ever. Spaces in names of files and directories are not always guaranteed to be handled correctly, and they are especially evil at start or end, where some software could decide to just trim them away.
    3) you should probably not have "cartouchehunter-svn/" in the same place where you have "scripts/". That looks like you tried to rename " cartouchehunter-svn/" to "cartouchehunter-svn/", but instead created the second in the first.

  7. #17

    Default

    the name of that directory, " cartouchehunter-svn/", starts with a space. Don't do that. Ever.
    Originally Posted by xKiv View Post
    Ah, yea, that was a combo of me being unobservant and TortoiseSVN automatically creating folders. When I copied the https:// address from sourceforge, I removed some command line stuff from the start, but didn't notice the " cartouchehunter-svn" after, so TortoiseSVN interpreted that as a folder name.
    It looks like I got the repository cleaned up, and I was able to "svn checkout https://svn.code.sf.net/p/cartouchehunter/svn/".

    However, instead of making a "cartouchehunter" folder in mafia's SVN folder, it named the folder "72fd6657-9ca6-454e-98b5-a35926876534". During mafia's svn checkout, it also asked if I wanted to overwrite the script in my TortoiseSVN checkout development folder. I'm able to run CartoucheHunter from the CLI, but I'd like to figure out that folder name. I'm not sure if it's just doing that for me due to some interaction with the TortoiseSVN checkout development folder, or what.
    Edit: I asked my bf to try downloading it and it had the same/similar junk folder name on his comupter. That got me thinking some more, and I guess I don't know how mafia picks the folder name. Is it parsing the https:// string, and since mine has "/svn" instead of "/code" it's getting thrown off?
    Last edited by ungawa; 03-29-2015 at 05:57 PM.

  8. #18
    Senior Member
    Join Date
    Apr 2009
    Posts
    1,656

    Default

    During mafia's svn checkout, it also asked if I wanted to overwrite the script in my TortoiseSVN checkout development folder. I'm able to run CartoucheHunter from the CLI, but I'd like to figure out that folder name. I'm not sure if it's just doing that for me due to some interaction with the TortoiseSVN checkout development folder, or what.
    Originally Posted by ungawa View Post
    Is your development folder *inside* mafia's folder? I don't think that's supposed to work.
    Either develop in a completely separate place (and copy files around), or inside .kolmafia/svn/, and .. there should be a command to automatically synchronize from there to "live" scripts ... "svn sync"?

    However, instead of making a "cartouchehunter" folder in mafia's SVN folder, it named the folder "72fd6657-9ca6-454e-98b5-a35926876534".
    Originally Posted by ungawa View Post
    That's problably the svn/ instead of code/ bit, I think I saw a request for mafia to recognize that.
    Last edited by xKiv; 03-29-2015 at 05:59 PM.

  9. #19

    Default

    Is your development folder *inside* mafia's folder? I don't think that's supposed to work.

    That's problably the svn/ instead of code/ bit, I think I saw a request for mafia to recognize that.
    Originally Posted by xKiv View Post
    Thanks. Yea, moving my development folder out fixed the issue with mafia trying to overwrite it at checkout.

    OK, cool. I'll live with the goofy folder name for now I guess. Thanks!

  10. #20
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,224

    Default

    Someone was recently confused by a lack of updates in this thread. I am posting this old-ish news so that important information is up to date.


    Actually it looks like svnkit doesn't yet have a stable version that supports 1.8, so I won't be doing that until they do.
    Originally Posted by roippi View Post
    That is no longer true. Heeheehee updated KoLmafia to support svn 1.8 in revisions 16072-16074 last year.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


Similar Threads

  1. A request and possible challenge to the master scripters
    By Tom Sawyer in forum Turn-Burning Scripts
    Replies: 21
    Last Post: 12-18-2014, 03:27 PM
  2. xpath primer
    By roippi in forum Scripting Discussion
    Replies: 5
    Last Post: 10-03-2014, 06:39 PM
  3. Quick ? need a little help.
    By Cereal Killer 024 in forum Community Support
    Replies: 13
    Last Post: 11-06-2013, 06:12 PM
  4. Replies: 8
    Last Post: 08-15-2010, 11:18 PM
  5. Quick Q:
    By icon315 in forum Community Support
    Replies: 2
    Last Post: 02-05-2010, 01:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •