Commits

iproetel committed 4f6fee1

Omitt changeset ids on review requests with only one changeset

  • Participants
  • Parent commits 5b4fd60

Comments (0)

Files changed (2)

 rm_trailing_ws.patch
 outgoingrepo.patch
 abort.patch
-qpostreview.patch
+qpostreview.patch
+short-description.patch

File short-description.patch

+# HG changeset patch
+# Parent ddf844f63768f47b1f518682e5b5994ea124a26f
+If only one changeset is part of the review omitt the changeset ids.
+
+diff -r ddf844f63768 mercurial_reviewboard/__init__.py
+--- a/mercurial_reviewboard/__init__.py	Thu Jun 23 21:01:10 2011 +0200
++++ b/mercurial_reviewboard/__init__.py	Tue Jul 05 18:06:34 2011 +0200
+@@ -336,10 +336,14 @@
+ 
+     all_contexts = find_contexts(repo, parentc, c, opts)
+ 
+-    changesets_string = 'changesets:\n'
+-    changesets_string += \
+-        ''.join(['\t%s:%s "%s"\n' % (ctx.rev(), ctx, ctx.description()) \
+-                 for ctx in all_contexts])
++    if len(all_contexts) == 1 :
++        changesets_string = '%s' % all_contexts[0].description()
++    else:
++        changesets_string = 'changesets:\n'
++        changesets_string += \
++            ''.join(['\t%s:%s "%s"\n' % (ctx.rev(), ctx, ctx.description()) \
++                     for ctx in all_contexts])
++
+     if opts['branch']:
+         branch_msg = "review of branch: %s\n\n" % (c.branch())
+         changesets_string = branch_msg + changesets_string