[Svnmerge] [PATCH] Indented log patch modified v4
Raman Gupta
rocketraman at fastmail.fm
Wed Mar 1 13:01:18 PST 2006
Alan Barrett wrote:
> On Wed, 01 Mar 2006, Raman Gupta wrote:
>> Attached v3 of the indent patch.
>
>> +def prefix_lines(prefix, lines):
>> + """Given a string representing lines of text,
>> + insert the specified prefix at the begining of each line,
>> + and return the result."""
>> +
>> + if len(lines) > 0:
>> + return "\n".join([prefix + L for L in lines.split("\n")])
>> + else:
>> + return ""
>
> This function assumes that the last line will not be terminated by "\n".
> That assumption should be documented.
I improved the pydoc on the function, as well as added a test case to
svnmerge_test.py for the prefix_lines function. I also removed the
unrequired check for zero length lines in that function. Attached is v4
of the patch.
Commit log msg:
Indent the merged revisions' log messages when creating the commit log
message after executing svn merge.
Patch by: Alan Barrett <apb at cequrux.com>
Reviewed by: Giovanni Bajo <rasky at develer.com>
Tweaked by: Raman Gupta <rocketraman at fastmail.fm>
* contrib/client-side/svnmerge.py
(prefix_lines):
New method to take a string and prepend each line of the string
with a specified string. Lines are delimited by newline
characters.
(construct_merged_log_message):
Added indentation for each commit message. Added check for empty
log messages, which should never happen but doesn't hurt.
Cheers,
Raman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log-indent-v4.patch
Type: text/x-patch
Size: 2677 bytes
Desc: not available
Url : /pipermail/svnmerge/attachments/20060301/55856a1e/attachment.bin
More information about the Svnmerge
mailing list