[asterisk-dev] [Code Review] Modify merge message so commit log message comes first.

rmudgett reviewboard at asterisk.org
Thu Sep 29 19:57:58 CDT 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1451/#review4459
-----------------------------------------------------------


These changes will make multiple revision commit messages readable.


/svnmerge
<https://reviewboard.asterisk.org/r/1451/#comment8612>

    Change these lines to:
    LOG_SEPARATOR = 8 * '.'
    



/svnmerge
<https://reviewboard.asterisk.org/r/1451/#comment8613>

    Replace this function with:
    def construct_merged_log_message(url, revnums):
        """Return a commit log message containing all the commit messages
        in the specified revisions at the given URL.  Trailing newlines are
        removed from the embedded log messages."""
        messages = []
        if len(revnums) == 1:
            r = min(revnums.sorted())
            message = get_commit_log(url, r)
            if message:
                message = re.sub(r'(\r\n|\r|\n)', "\n", message)
                # Kill the first two housekeeping lines that are generated by svn log
                message = re.sub(r'^.*?\n.*?\n', '', message)
                message = rstrip(message, "\n") + "\n"
                messages.append(message)
        else:
            messages.append("Multiple revisions " + str(revnums) + "\n\n")
            for r in revnums.sorted():
                message = get_commit_log(url, r)
                if message:
                    message = re.sub(r'(\r\n|\r|\n)', "\n", message)
                    message = rstrip(message, "\n") + "\n"
                    messages.append(prefix_lines(LOG_LINE_PREFIX, message))
    
        separator = LOG_SEPARATOR + "\n"
        return separator.join(messages)
    



/svnmerge
<https://reviewboard.asterisk.org/r/1451/#comment8614>

    Fixes syntax error and fix line spacing by replacing these lines with:
            if opts["commit-verbose"]:
                if record_only:
                    print >>f
                    print >>f, LOG_SEPARATOR
                print >>f, construct_merged_log_message(opts["source-url"], revs),
                if not record_only:
                    print >>f, LOG_SEPARATOR
                    print >>f
            if not record_only:
                print >>f, 'Merged revisions %s from %s' % \
                      (revs, opts["asterisk-url"])
    



/svnmerge
<https://reviewboard.asterisk.org/r/1451/#comment8615>

                print >>f
                print >>f, LOG_SEPARATOR
    



/svnmerge
<https://reviewboard.asterisk.org/r/1451/#comment8616>

                print >>f
                print >>f, LOG_SEPARATOR
    


- rmudgett


On Sept. 22, 2011, 3:47 a.m., Tilghman Lesher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1451/
> -----------------------------------------------------------
> 
> (Updated Sept. 22, 2011, 3:47 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Some discussion was made several weeks ago about modifying the svnmerge log message, such that the committer's log message comes first in any merge, followed by details on where the commit was originally made.  This improves our overall log messages.  Also, the URL is modified in the message as to show the public path, instead of the commit path, which is not available to most.
> 
> 
> Diffs
> -----
> 
>   /svnmerge 795 
> 
> Diff: https://reviewboard.asterisk.org/r/1451/diff
> 
> 
> Testing
> -------
> 
> Currently, an example message is as follows (after 2 merges):
> 
> -----start message-----
> 
> 
> More silly spacing changes
> 
> .....
> Merged revisions 337353 from http://svn.asterisk.org/svn/asterisk/branches/1.8
> 
> .....
> Merged revisions 337380 from http://svn.asterisk.org/svn/asterisk/branches/10
> -----end message-----
> 
> 
> Thanks,
> 
> Tilghman
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110930/4620d173/attachment-0001.htm>


More information about the asterisk-dev mailing list