Commits

Patrick Mézard  committed 8529b4b

evolve: tidy up a bit

- long lines
- extra blank lines
- commands options descriptions

  • Participants
  • Parent commits d68ccae
  • Branches default

Comments (0)

Files changed (1)

File hgext/evolve.py

 
 ### util function
 #############################
+
 def noderange(repo, revsets):
     """The same as revrange but return node"""
     return map(repo.changelog.node,
                scmutil.revrange(repo, revsets))
 
-
-
 def warnunstable(orig, ui, repo, *args, **kwargs):
     """display warning is the command resulted in more instable changeset"""
     priorunstables = len(repo.revs('unstable()'))
         if newunstables > 0:
             ui.warn(_('%i new unstables changesets\n') % newunstables)
 
-
-### extension check
-#############################
-
-
 ### changeset rewriting logic
 #############################
 
         else:
             rebase.rebasenode(repo, orig.node(), dest.node(),
                               {node.nullrev: node.nullrev})
-        nodenew = rebase.concludenode(repo, orig.node(), dest.node(), node.nullid)
+        nodenew = rebase.concludenode(repo, orig.node(), dest.node(),
+                                      node.nullid)
         oldbookmarks = repo.nodebookmarks(nodesrc)
         if nodenew is not None:
             phases.retractboundary(repo, destphase, [nodenew])
         repo.dirstate.invalidate()
         raise
 
-
 def stabilizableunstable(repo, pctx):
     """Return a changectx for an unstable changeset which can be
     stabilized on top of pctx or one of its descendants. None if none
 command = cmdutil.command(cmdtable)
 
 @command('^stabilize|evolve',
-    [
-     ('n', 'dry-run', False, 'Do nothing but printing what should be done'),
-     ('A', 'any', False, 'Stabilize unstable change on any topological branch'),
-    ],
-    '')
+    [('n', 'dry-run', False, 'do not perform actions, print what to be done'),
+    ('A', 'any', False, 'stabilize any unstable changeset'),],
+    _('[OPTIONS]...'))
 def stabilize(ui, repo, **opts):
     """rebase an unstable changeset to make it stable again
 
 shorttemplate = '[{rev}] {desc|firstline}\n'
 
 @command('^gdown',
-    [],
-    'update to working directory parent and display summary lines')
+         [],
+         '')
 def cmdgdown(ui, repo):
-    """update to working directory parent an display summary lines"""
+    """update to parent an display summary lines"""
     wkctx = repo[None]
     wparents = wkctx.parents()
     if len(wparents) != 1:
         return 1
 
 @command('^gup',
-    [],
-    'update to working directory children and display summary lines')
+         [],
+         '')
 def cmdup(ui, repo):
-    """update to working directory children an display summary lines"""
+    """update to child an display summary lines"""
     wkctx = repo[None]
     wparents = wkctx.parents()
     if len(wparents) != 1:
         ui.warn(_('Multiple non-obsolete children, explicitly update to one\n'))
         return 1
 
-
 @command('^kill|obsolete',
-    [
-    ('n', 'new', [], _("New changeset that justify this one to be killed"))
-    ],
-    '<revs>')
+    [('n', 'new', [], _("successor changeset"))],
+    _('[OPTION] REV...'))
 def kill(ui, repo, *revs, **opts):
     """mark a changeset as obsolete
 
 @command('^amend|refresh',
     [('A', 'addremove', None,
      _('mark new/missing files as added/removed before committing')),
-    ('n', 'note', '',
-     _('use text as commit message for this update')),
-    ('c', 'change', '',
-     _('specifies the changeset to amend'), _('REV')),
-    ('e', 'edit', False,
-     _('edit commit message.'), _('')),
+    ('n', 'note', '', _('use text as commit message for this update')),
+    ('c', 'change', '', _('specifies the changesets to amend'), _('REV')),
+    ('e', 'edit', False, _('invoke editor on commit messages')),
     ] + walkopts + commitopts + commitopts2,
     _('[OPTION]... [FILE]...'))
-
 def amend(ui, repo, *pats, **opts):
     """combine a changeset with updates and replace it with a new one
 
 
     If you don't specify -m, the parent's message will be reused.
 
-    If you specify --change, amend additionally considers all changesets between
-    the indicated changeset and the working copy parent as updates to be subsumed.
+    If you specify --change, amend additionally considers all
+    changesets between the indicated changeset and the working copy
+    parent as updates to be subsumed.
 
     Behind the scenes, Mercurial first commits the update as a regular child
     of the current parent. Then it creates a new commit on the parent's parents
         wlock = repo.wlock()
         try:
             if old.phase() == phases.public:
-                raise util.Abort(_("can not rewrite immutable changeset %s") % old)
+                raise util.Abort(_("can not rewrite immutable changeset %s")
+                                 % old)
             oldphase = old.phase()
             # commit current changes as update
             # code copied from commands.commit to avoid noisy messages
             ciopts['message'] = opts.get('note') or ('amends %s' % old.hex())
             e = cmdutil.commiteditor
             def commitfunc(ui, repo, message, match, opts):
-                return repo.commit(message, opts.get('user'), opts.get('date'), match,
-                                   editor=e)
+                return repo.commit(message, opts.get('user'), opts.get('date'),
+                                   match, editor=e)
             revcount = len(repo)
             tempid = cmdutil.commit(ui, repo, commitfunc, pats, ciopts)
             if len(repo) == revcount:
                     raise error.Abort(_('no updates found'))
             updates = [repo[n] for n in updatenodes]
 
-
-
             # perform amend
             if opts.get('edit'):
                 opts['force_editor'] = True
     finally:
         lock.release()
 
-
-
-
 def commitwrapper(orig, ui, repo, *arg, **kwargs):
     lock = repo.lock()
     try:
         raise error.Abort(_('evolution extension require rebase extension.'))
 
     entry = extensions.wrapcommand(commands.table, 'commit', commitwrapper)
-    entry[1].append(('o', 'obsolete', [], _("this commit obsolet this revision")))
+    entry[1].append(('o', 'obsolete', [],
+                     _("make commit obsolete this revision")))
     entry = extensions.wrapcommand(commands.table, 'graft', graftwrapper)
-    entry[1].append(('o', 'obsolete', [], _("this graft obsolet this revision")))
-    entry[1].append(('O', 'old-obsolete', False, _("graft result obsolete graft source")))
+    entry[1].append(('o', 'obsolete', [],
+                     _("make graft obsoletes this revision")))
+    entry[1].append(('O', 'old-obsolete', False,
+                     _("make graft obsoletes its source")))
 
     # warning about more obsolete
     for cmd in ['commit', 'push', 'pull', 'graft']: