[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Multiline log message checking

From: <kfogel_at_collab.net>
Date: 2005-04-27 16:56:32 CEST

Vivek <vivek@collab.net> writes:
> [[[
> Multiple line log messages are committed
> and then later checked, rather than single
> line log messages. Inspiration from todo in
> the file
> ]]]

By convention, the stuff between "[[[ ... ]]]" is the log message.
But the above is not your log message, and also isn't very clear :-).
I can't tell if it's fixing a bug in Subversion, or fixing a test for
a bug, or something else.

Your real (attached) log message was this:

   Added multiline log checking in log_tests.py
   
   */subversion/tests/clients/cmdline
    guarantee_repos_and_wc(sbox):Code to create
    multiline log messages to even numbered commits.
    parse_log_output(log_lines):Added a new key
    'lines' in the hash to test it against revision
    check_log_chain (chain, revlist):The actual
    checking takes place here. But nothing fancy.
    log_through_copyfrom_history(sbox):change log
    message.

Some formatting comments: you don't need to include the parameters
when naming methods. But you should wrap the methods themselves in
parens. Please have a space after a colon, and after the asterisk.
See HACKING, and also run 'svn log', for guidelines and example log
messages.

The change itself looked good; I had one comment, see below.

> Index: log_tests.py
> ===================================================================
> --- log_tests.py (revision 14458)
> +++ log_tests.py (working copy)
> @@ -91,8 +91,11 @@
> # is done for that.
>
> # Revision 2: edit iota
> + msg=""" Log message for revision 2
> + but with multiple lines
> + to test the code"""
> svntest.main.file_append (iota_path, "2")
> - svntest.main.run_svn (None, 'ci', '-m', "Log message for revision 2")
> + svntest.main.run_svn (None, 'ci', '-m', msg)
> svntest.main.run_svn (None, 'up')
>
> # Revision 3: edit A/D/H/omega, A/D/G/pi, A/D/G/rho, and A/B/E/alpha
> @@ -104,10 +107,13 @@
> svntest.main.run_svn (None, 'up')
>
> # Revision 4: edit iota again, add A/C/epsilon
> + msg=""" Log message for revision 4
> + but with multiple lines
> + to test the code"""
> svntest.main.file_append (iota_path, "4")
> svntest.main.file_append (epsilon_path, "4")
> svntest.main.run_svn (None, 'add', epsilon_path)
> - svntest.main.run_svn (None, 'ci', '-m', "Log message for revision 4")
> + svntest.main.run_svn (None, 'ci', '-m', msg)
> svntest.main.run_svn (None, 'up')
>
> # Revision 5: edit A/C/epsilon, delete A/D/G/rho
> @@ -117,9 +123,12 @@
> svntest.main.run_svn (None, 'up')
>
> # Revision 6: prop change on A/B, edit A/D/H/psi
> + msg=""" Log message for revision 6
> + but with multiple lines
> + to test the code"""
> svntest.main.run_svn (None, 'ps', 'blue', 'azul', B_path)
> svntest.main.file_append (psi_path, "6")
> - svntest.main.run_svn (None, 'ci', '-m', "Log message for revision 6")
> + svntest.main.run_svn (None, 'ci', '-m', msg)
> svntest.main.run_svn (None, 'up')
>
> # Revision 7: edit A/mu, prop change on A/mu
> @@ -129,10 +138,13 @@
> svntest.main.run_svn (None, 'up')
>
> # Revision 8: edit iota yet again, re-add A/D/G/rho
> + msg=""" Log message for revision 8
> + but with multiple lines
> + to test the code"""
> svntest.main.file_append (iota_path, "8")
> svntest.main.file_append (rho_path, "8")
> svntest.main.run_svn (None, 'add', rho_path)
> - svntest.main.run_svn (None, 'ci', '-m', "Log message for revision 8")
> + svntest.main.run_svn (None, 'ci', '-m', msg)
> svntest.main.run_svn (None, 'up')
>
> # Revision 9: edit A/B/E/beta, delete A/B/E/alpha
> @@ -183,7 +195,7 @@
> 'author' ===> string
> 'date' ===> string
> 'msg' ===> string (the log message itself)
> -
> + 'line' ===> number (so that it may be checked against rev)
> If LOG_LINES contains changed-path information, then the hash
> also contains
>
> @@ -237,6 +249,7 @@
> this_item['author'] = match.group(2)
> this_item['date'] = match.group(3)
> lines = string.atoi ((match.group (4)))
> + this_item['lines'] = lines
>
> # Eat the expected blank line.
> log_lines.pop (0)
> @@ -295,6 +308,11 @@
> if (not (author_re.search (author)
> or author == ''
> or author == '(no author)')): raise svntest.Failure
> + # if revision is an even number then it should have
> + # a three line log message
> + # but don't try to do anything fancy as the todo below suggests
> + if(saw_rev%2==0 and log_item['lines']!=3):raise svntest.Failure
> +

I think you can remove that 'todo' comment, and adjust the above
accordingly. You solved the same problem in a simpler way.

Don't be afraid to remove stuff like that -- it's all under version
control anyway :-).

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Apr 27 17:47:04 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.