diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-10-16 20:45:10 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-10-16 20:45:10 -0700 |
commit | 630ea9d916bd6e09a1af6414ae7fbe83ecd2331f (patch) | |
tree | 4900ac1df7d154f285502617ef89870cf286944a | |
parent | 5e2982d998ac5683612de4a776f92a0887a8839d (diff) | |
download | portage-630ea9d916bd6e09a1af6414ae7fbe83ecd2331f.tar.gz portage-630ea9d916bd6e09a1af6414ae7fbe83ecd2331f.tar.bz2 portage-630ea9d916bd6e09a1af6414ae7fbe83ecd2331f.zip |
UpdateChangeLog: show trivial if nothing else
Like echangelog does, show ChangeLog or Manifest if there are no other
changes to display.
-rw-r--r-- | pym/repoman/utilities.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py index e4fc1a45b..e0687491a 100644 --- a/pym/repoman/utilities.py +++ b/pym/repoman/utilities.py @@ -603,11 +603,26 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, msg, prete newebuild = True if newebuild: clnew_lines.append(_unicode_decode('\n')) - new = ['+' + elem for elem in new if elem not in ['ChangeLog', 'Manifest']] - removed = ['-' + elem for elem in removed] - changed = [elem for elem in changed if elem not in ['ChangeLog', 'Manifest']] - mesg = '%s; %s %s:' % (date, user, \ - ', '.join(chain(new,removed,changed))) + trivial_files = ('ChangeLog', 'Manifest') + display_new = ['+' + elem for elem in new + if elem not in trivial_files] + display_removed = ['-' + elem for elem in removed] + display_changed = [elem for elem in changed + if elem not in trivial_files] + if not (display_new or display_removed or display_changed): + # If there's nothing else to display, show one of the + # trivial files. + if 'ChangeLog' in new: + display_new = ['+ChangeLog'] + elif 'ChangeLog' in changed: + display_changed = ['ChangeLog'] + elif 'Manifest' in new: + display_new = ['+Manifest'] + elif 'Manifest' in changed: + display_changed = ['Manifest'] + + mesg = '%s; %s %s:' % (date, user, ', '.join(chain( + display_new, display_removed, display_changed))) for line in textwrap.wrap(mesg, 80, \ initial_indent=' ', subsequent_indent=' ', \ break_on_hyphens=False): |