Opened 17 years ago
Closed 14 years ago
#7175 closed enhancement (wontfix)
The trac-post-commit-hook for svn makes for verbose comments with svnmerge
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | |
Severity: | normal | Keywords: | hook svnmerge patch |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I like to use the trac-post-commit-hook with svn to keep changesets associated with tickets. However, when using svnmerge, the default svnmerge comment includes all comments from the associated checkins, thereby causing duplicate, overly verbose comments to be added to all those tickets. I've found it useful to have this commit hook detect a svnmerge comment and only indicate a merge direction in the trac ticket, so I'm submitting a patch that does this. My knowledge of trac is minimal, my python really rusty, so this will probably need some work, but the concept should be sound, and it does work for me.
Attachments (1)
Change History (5)
by , 17 years ago
Attachment: | trac-svnmerge-commit-hook.diff added |
---|
comment:1 by , 16 years ago
Keywords: | patch added; post commit svn removed |
---|---|
Milestone: | → 2.0 |
Owner: | removed |
Interesting.
comment:2 by , 16 years ago
Interesting… I wrote a similar patch just a couple months ago, and didn't know about this one. It's definitely worth considering. Prior to the patch, every time I did a merge, every ticket related to the merge would get updated with a very long message containing the change messages of every change that was merged. Sure it's possible to manually edit the generated commit message, but that's inconvenient.
Here's my version of the patch:
-
trunk/OmniPoint/Source/SVNHooks/trac-post-commit-hook
124 124 command_re = re.compile(ticket_command) 125 125 ticket_re = re.compile(ticket_prefix + '([0-9]+)') 126 svnmerge_actions = ['Merged', 'Blocked', 'Unblocked', 'Recorded rollback of'] 127 svnmerge_re = re.compile(r'^\(In \[\d+\]\) (?:%s) revisions [\d,-]+ via ' 128 'svnmerge' % '|'.join(svnmerge_actions)) 129 svnmerge_revsplit_re = re.compile(r'(\d),(\d)') 126 130 127 131 class CommitHook: … … 165 169 tickets.setdefault(tkt_id, []).append(func) 166 170 171 if svnmerge_re.match(self.msg): 172 self.msg = svnmerge_revsplit_re.sub(r'\1, \2', 173 self.msg.split('\n')[0]) 174 167 175 for tkt_id, cmds in tickets.iteritems(): 168 176 try:
The version of revsplit_re
is to insert spaces into the comma-separated list of merged revisions, which can sometimes be very long, and otherwise won't wrap.
comment:4 by , 14 years ago
Milestone: | triaging |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
svnmerge
has been replaced by svn merge
and svn:mergeinfo
properties. AFAIK, svn merge
doesn't generate a "summary" message containing all the merged changeset messages, so this issue doesn't happen anymore.
patch to make post commit hook less verbose when using svnmerge