Changeset 460


Ignore:
Timestamp:
08-01-10 18:02:07 (3 years ago)
Author:
thomas
Message:

patch by: Jan Urbanski

  • moap/command/cl.py: Add options to moap changelog prepare for --no-date, --no-reviewer, --no-update. Revised patch for spelling and removing double negative logic. Fixes #414.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r459 r460  
     12010-01-08  Thomas Vander Stichele  <thomas at apestaart dot org> 
     2 
     3        patch by: Jan Urbanski 
     4 
     5        * moap/command/cl.py: 
     6          Add options to moap changelog prepare for 
     7          --no-date, --no-reviewer, --no-update. 
     8          Revised patch for spelling and removing double negative logic. 
     9          Fixes #414. 
     10 
    1112010-01-08  Thomas Vander Stichele  <thomas at apestaart dot org> 
    212 
  • trunk/moap/command/cl.py

    r391 r460  
    513513            action="store_true", dest="ctags", default=False, 
    514514            help="Use ctags to extract and add changed tags to ChangeLog entry") 
     515        self.parser.add_option('-d', '--no-date', 
     516            action="store_false", dest="date", default=True, 
     517            help="Don't prefix the ChangeLog entry with a date") 
     518        self.parser.add_option('-r', '--no-reviewer', 
     519            action="store_false", dest="reviewer", default=True, 
     520            help="Don't prefix the ChangeLog entry with patch-by " 
     521                 "and reviewed-by fields") 
     522        self.parser.add_option('-u', '--no-update', 
     523            action="store_false", dest="update", default=True, 
     524            help="Don't update the ChangeLog from VCS") 
    515525 
    516526    def do(self, args): 
     
    540550            return 3 
    541551 
    542         self.stdout.write('Updating %s from %s repository.\n' % (clPath, 
    543             v.name)) 
    544         try: 
    545             v.update(clPath) 
    546         except vcs.VCSException, e: 
    547             self.stderr.write('Could not update %s:\n%s\n' % ( 
    548                 clPath, e.args[0])) 
    549             return 3 
     552        if self.options.update: 
     553            self.stdout.write('Updating %s from %s repository.\n' % (clPath, 
     554                v.name)) 
     555            try: 
     556                v.update(clPath) 
     557            except vcs.VCSException, e: 
     558                self.stderr.write('Could not update %s:\n%s\n' % ( 
     559                    clPath, e.args[0])) 
     560                return 3 
    550561 
    551562        self.stdout.write('Finding changes.\n') 
     
    608619        self.stdout.write('Editing %s.\n' % clPath) 
    609620        (fd, tmpPath) = tempfile.mkstemp(suffix='.moap') 
    610         os.write(fd, "%s  %s  <%s>\n\n" % (date, name, mail)) 
    611         os.write(fd, "\treviewed by: %s\n" % _defaultReviewer); 
    612         os.write(fd, "\tpatch by: %s\n" % _defaultPatcher); 
    613         os.write(fd, "\n") 
     621        if self.options.date: 
     622            os.write(fd, "%s  %s  <%s>\n\n" % (date, name, mail)) 
     623        if self.options.reviewer: 
     624            os.write(fd, "\treviewed by: %s\n" % _defaultReviewer); 
     625            os.write(fd, "\tpatch by: %s\n" % _defaultPatcher); 
     626            os.write(fd, "\n") 
    614627 
    615628        if changes: 
Note: See TracChangeset for help on using the changeset viewer.