Prompt for Comment on SVN checkin

Prompt for Comment on SVN checkin

1

    Nov 13, 2009#1

    Those of you who use SubVersion know that you need to supply a message/comment when you check in files. I'd like to integrate UE with SVN nicely, i.e., hit some hotkey, have UE prompt me for my message, and then call the svn command line appropriately. Is this possible? I've set up a Tool Configuration to do the checkin, and currently use the %modify% token, but it's clunky because I have to edit the entire command line rather than just type my comment into a text box.

    I know I can script a solution for this kind of thing in <your-favorite-scripting-language-here>, but was hoping for a cleaner solution than that.

    Thanks for your thoughts.

    44
    Basic UserBasic User
    44

      Jan 21, 2010#2

      Hi jeblackburn,

      This is what I do.

      Make sure this is NOT selected: Menu bar > Advanced > Alternate Capture Method

      Now to set up my SVN tasks..

      This one will bring up Notepad so that I can write in my own comment (and then save Notepad and close it).
      Menu bar > Advanced > Tool Configuration > click Insert > Command tab
      - Menu Item Name: SVN commit and write comment
      - Command Line: svn.exe commit %N%E --editor-cmd notepad.exe
      - Working Directory: %p
      Options tab
      - Program Type: DOS Program
      - Select Save Active File
      Output tab
      - Command Output (DOS Commands): Output to list box.
      - Select Capture Output
      - Replace selected text with: No Replace

      I have another task called "SVN commit from UE" that uses a default commit message. The command line is:
      svn.exe commit %N%E --editor-cmd notepad.exe -m "- Robert Mark Bram. Periodic update from UltraEdit."

      Heaps more details about the SVN tasks I have set up on my blog post, "Subversion commit from Ultraedit": http://robertmarkbramprogrammer.blogspo ... aedit.html

      HTH

      Rob
      :)

        Jan 22, 2010#3

        Also, you can leave out

        Code: Select all

        --editor-cmd notepad.exe
        if you set the SVN_EDITOR environment variable.

        Interestingly, I tried setting SVN_EDITOR to UltraEdit, but it didn't work. SVN looks for the editor process to end before taking the contents of the file you have just edited as a comment for the checkin, and you just get an error if you try this with UltraEdit already open.

        You can use the EDITOR variable on Windows instead (see http://www.svnforum.org/2017/viewtopic. ... 8156#28156) which allows the use of a (multi tabbed) editor already in use, but this fails when launched from UltraEdit because SVN requires user input - which it can't get.

        Some editors (like Notepad++) allow command line switches that will open a new instance. So I have SVN_EDITOR set to "notepad++ -multiInst", so that when I checkin through UltraEdit, a new instance of notepad++ is opened (just in case I happen to already have an instance open already).

        Why do I bother? A bit to see if I can. :) But also because I launch UltraEdit from Cygwin, and Notepad doesn't handle the Linux line endings nicely..

        Rob
        :)
        UltraEdit - licensed for life!

        http://robertmarkbramprogrammer.blogspot.com

        6,602548
        Grand MasterGrand Master
        6,602548

          Jan 22, 2010#4

          Just a hint for StaticGhost: UltraEdit has also a switch to force a new instance, it is /fni which must be the first command line parameter (= first after the EXE name). For completeness, using /foi forces opening the file in the original (first) instance of UltraEdit if there are multiple instances running.
          Best regards from an UC/UE/UES for Windows user from Austria

          44
          Basic UserBasic User
          44

            Jan 22, 2010#5

            Mofi wrote:UltraEdit has also a switch to force a new instance, it is /fni which must be the first command line parameter
            Nice one Mofi! So, either of these work ok (as long as you have their install directories in your path):
            SVN_EDITOR="notepad++ -multiInst"
            SVN_EDITOR="Uedit32.exe /fni"

            Rob
            :)

              Jul 05, 2012#6

              I don't use command line SVN for this anymore - I use Tortoise SVN which has much better tooling for checkin dialogs etc. This was suggested by Daniel K, a commenter on one the blog post I wrote about this very post!

              E.g. a commit:

              Code: Select all

              TortoiseProc.exe /command:commit /path:"%f" /closeonend:1
              Or a diff:

              Code: Select all

              TortoiseProc.exe /command:diff /path:"%f" /closeonend:1
              Rob
              :)