[TxMt] SVN log templates

Allan Odgaard throw-away-1 at macromates.com
Fri Jul 20 12:16:26 UTC 2007

On 18. Jul 2007, at 22:04, Mat Schaffer wrote:

> Is there a "right way" to allow for SVN log templates?  Basically  
> I'd like to be able to easily populate the comments section of the  
> CommitWindow with a template (or snippet, or...).

By “comments section” do you mean the “Summary of changes” text field?

> The best I've found so far is adding:
> @commit_args.gsub!("-m ''", '')
> to /Applications/TextMate.app/Contents/SharedSupport/Bundles/ 
> Subversion.tmbundle/Support/svn_commit.rb
> Which causes the svn's client behavior to kick in and spawn EDITOR  
> (mate -w) to write comments.  Is this as good as it gets?

There isn’t any support for what I think you’re asking -- but it can  
probably be added.

Likely your problem with the EDITOR stuff comes from treating the  
result incorrectly (not handling proper escaping etc.).

If ‘res’ is the result from calling CommitWindow.app then you can do:

     res   = Shellwords.shellwords(res)
     msg   = res[1]
     files = res[2..-1]

Now ‘msg’ is the commit message and ‘files’ is an array of the files  
to commit. But when calling svn, you’ll need to use e_sh for ‘msg’  
and each file.

If you need further help, please be more specific of what your end  
goal here is.

More information about the textmate mailing list