mån 3 okt. 2016 kl 20:20 skrev Stefan Küng <tortoisesvn_at_gmail.com>:
> On 03.10.2016 17:20, Ragnar Hägg wrote:
> > I want to create a bat script that uses TortoiseSVN to update a svn
> > repo. It should be able to handle the repo being locked from if
> > something went wrong the last update.
> >
> > What I tried was this (running 1.9.4):
> >
> > START /WAIT TortoiseProc.exe /command:cleanup /path:"c:\svn\repoName"
> > /cleanup /noui /nodlg
> > START TortoiseProc.exe /command:update /path:"c:\svn\repoName"
> /closeonend:2
> >
> > But the cleanup command doesn't seem to handle breaking locks. When I
> > run the cleanup command without /noui I get the cleanup options, where
> > "Break locks" is an option, which isn't the case for 1.8.11. In the
> > documentation
> > (
> https://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-automation.html)
> > it says that the :cleanup command "Cleans up interrupted or aborted
> > operations and unlocks the working copy...".
>
> "unlocks the working copy" means getting rid of 'command locks', i.e.
> locks that are set to prevent other svn commands from interfering
> (similar to thread locks).
> And that's what you want. Breaking locks of user locked files is also
> possible, but I don't think that's what you're looking for.
>
> Why do you think it doesn't clean the 'command locks' when you run the
> cleanup?
>
I think it doesn't clean 'command locks' by default since when I run update
right after the cleanup (as my example above), it fails for reason:
Error: Working copy 'c:\svn\repoName' locked.
Error: 'c:\svn\repoName' is already locked.
Error: Please execute the 'Cleanup' command.
But this was fixed by the argument /breaklocks for cleanup. Byt since this
argument wasn't listed in the documentation I linked to it sounded like it
would do this automatically.
>
> > Is it possible that the "Break locks" functionality was removed as a
> > default behavior for cleanup when the option was introduced in later
> > versions, but no command line option to do it was added? Or is there a
> > way of doing this?
>
> Pass the /breaklocks parameter, which will break all locks which were
> set with the "get lock" command on files.
>
> other parameters for the cleanup command:
>
> /cleanup : runs cleanup
> /revert : also does a revert on the wc
> /delunversioned : removes all unversioned files and folders
> /delignored : removes all ignored files
> /refreshshell : forces a refresh of the explorer overlays
> /externals : includes all externals for the specified command(s)
> /breaklocks : removes all user file locks
> /fixtimestamps : changes the file times according to the last-commit-date
> /vacuum : removes unneeded metadata
>
> Stefan
>
Thanks you, /breaklocks was the argument I was looking for. I'm not sure if
I was looking at the wrong documentation, or if the documentation hasn't
caught up with the code, but I was googling for quite a while and couldn't
find it.
Best regards,
Ragnar
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3188311
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2016-10-04 08:54:00 CEST