[Updated] D10859: cmdutil: make checknotesize() work on str-keyed opts

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Mon Jun 21 12:17:08 UTC 2021


Closed by commit rHG54849b65dc5f: cmdutil: make checknotesize() work on str-keyed opts (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D10859?vs=28539&id=28632

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D10859/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D10859

AFFECTED FILES
  hgext/amend.py
  hgext/uncommit.py
  mercurial/cmdutil.py

CHANGE DETAILS

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -328,10 +328,10 @@
     return datemaydiffer
 
 
-def checknotesize(ui, opts):
+def check_note_size(opts):
     """make sure note is of valid format"""
 
-    note = opts.get(b'note')
+    note = opts.get('note')
     if not note:
         return
 
diff --git a/hgext/uncommit.py b/hgext/uncommit.py
--- a/hgext/uncommit.py
+++ b/hgext/uncommit.py
@@ -153,9 +153,8 @@
     If no files are specified, the commit will be pruned, unless --keep is
     given.
     """
+    cmdutil.check_note_size(opts)
     opts = pycompat.byteskwargs(opts)
-
-    cmdutil.checknotesize(ui, opts)
     cmdutil.resolvecommitoptions(ui, opts)
 
     with repo.wlock(), repo.lock():
diff --git a/hgext/amend.py b/hgext/amend.py
--- a/hgext/amend.py
+++ b/hgext/amend.py
@@ -16,7 +16,6 @@
 from mercurial import (
     cmdutil,
     commands,
-    pycompat,
     registrar,
 )
 
@@ -66,7 +65,7 @@
 
     See :hg:`help commit` for more details.
     """
-    cmdutil.checknotesize(ui, pycompat.byteskwargs(opts))
+    cmdutil.check_note_size(opts)
 
     with repo.wlock(), repo.lock():
         if not opts.get('logfile'):



To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210621/294976f5/attachment-0002.html>


More information about the Mercurial-patches mailing list