[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: easiest way to copy the SVN URL of a directory, to the system clipboard

From: Geoff Field <Geoff_Field_at_aapl.com.au>
Date: Fri, 31 Jul 2015 13:30:49 +1000

> From: Geoff Field [mailto:Geoff_Field_at_aapl.com.au]
>
> > De : Jason S [mailto:jmsachs_at_gmail.com]
> >
> > I often need to copy the SVN URL of a directory into a file for
> > documentation.
> >
> > Right now, the way I do it is to open the repo browser. This works
> > (URL is at the top, and is selectable), but our repo
> browser is SLOW
> > to open, and this seems like an unnecessary step.
> >
> > Is there a way to quickly copy to the clipboard the SVN URL of a
> > directory using TortoiseSVN? If not, is this a feature that
> could be
> > added somehow to the SVN log to the window that pops up when you
> > select TortoiseSVN -> Show Log? That window pops up quickly.
> >
> > ------------------------------------------------------
> >
> http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3129444
> >
> > To unsubscribe from this discussion, e-mail:
> > [users-unsubscribe_at_tortoisesvn.tigris.org].
> >
> > From: Sébastien Morin
> >
> > In the Windows Explorer, if you go in the properties of the file or
> > folder under source control, you have a Subversion tab that
> is added
> > and the URL is selectable.
>
> Hi Jason,
>
> We have a set of Python scripts that have been implemented
> using a right-click menu:
> 1) Show SVN URL
> 2) Copy Latest SVN URL
> 3) Copy Specific SVN URL
>
> I suspect these rely on the command-line SVN tools being in the path.
>
> If you like, I can send the installation files to you
> off-list. I have been able to find the original Python files as well.
>
> Regards,
>
> Geoff
>
> ------------------------------------------------------
> http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3129511
>
> To unsubscribe from this discussion, e-mail:
> [users-unsubscribe_at_tortoisesvn.tigris.org].

Correction: The ones we actually use are Auto Hot-Key scripts. I don't think we ever got the Python version going reliably.

The scripts aren't big: Neither are the compiled executables.

For example, the active text of the Auto Hot-Key script to copy the head URL is:

; Script Function:
; Output the latest rev url of the file in the clipboard
; Requires the user to select the relevant file/folder, then press the hotkey combination

; copy the filename to the clipboard
clipboard = ; Empty the clipboard

; ensure a long path name is used, as SubWCRev.exe does not support short path names
Loop, %1%, 1
        vLongPathName = %A_LoopFileLongPath%

; get svn info from the copied file into the clipboard
vSrcFile = %A_Temp%\svnUrlSrcFile.txt
IfExist, %vSrcFile%
{
        FileDelete, %vSrcFile%
}
FileAppend,
(
$WCURL$
$WCREV$
), %vSrcFile%
vDestFile = %A_Temp%\svnUrlDestFile.txt
FileDelete, %vDestFile%
command = SubWCRev.exe "%vLongPathName%" %vSrcFile% %vDestFile% -f
RunWait, %command%,, Hide

IfNotExist, %vDestFile%
{
        vMessage = Error: The selected file/folder is not a Subversion working copy!
        MsgBox,, Latest Version Subversion URL, %vMessage%
}
Else
{
        FileReadLine, vUrl, %vDestFile%, 1
        FileReadLine, vRev, %vDestFile%, 2
        If vUrl =
        {
                vMessage = Error: The selected file/folder is not a Subversion working copy!
                MsgBox,, Latest Version Subversion URL, %vMessage%
        }
        Else
        {
                ;modify the url for wsvn
                StringReplace, vGeneralUrl, vUrl, Subversion, wsvn
                vSpecificUrl := vGeneralUrl . "?rev=" . vRev
                ;replace spaces with %20 for pasting into mantis and emails
                vUrl := RegExReplace(vUrl, " ","%20")
                ;output url
                clipboard := vUrl
        }
}

For the specific version, the output to the clipboard uses vSpecificUrl

-- 
Apologies for the auto-generated legal boilerplate added by our IT department:
- The contents of this email, and any attachments, are strictly private
and confidential.
- It may contain legally privileged or sensitive information and is intended
solely for the individual or entity to which it is addressed.
- Only the intended recipient may review, reproduce, retransmit, disclose,
disseminate or otherwise use or take action in reliance upon the information
contained in this email and any attachments, with the permission of
Australian Arrow Pty. Ltd.
- If you have received this communication in error, please reply to the sender
immediately and promptly delete the email and attachments, together with
any copies, from all computers.
- It is your responsibility to scan this communication and any attached files
for computer viruses and other defects and we recommend that it be
subjected to your virus checking procedures prior to use.
- Australian Arrow Pty. Ltd. does not accept liability for any loss or damage
of any nature, howsoever caused, which may result
directly or indirectly from this communication or any attached files.
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3129520
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2015-07-31 05:31:01 CEST

This is an archived mail posted to the TortoiseSVN Users mailing list.