D7605: formatting: fix some recent formatting regressions

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Dec 11 18:02:56 UTC 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/fuzz/mpatch_corpus.py
  mercurial/cmdutil.py

CHANGE DETAILS

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -793,14 +793,17 @@
             fm.data(unresolved=True)
 
     def formatfooter(self, fm):
-        statemsg = _(b'The repository is in an unfinished *%s* state.'
-                     ) % self.unfinishedop
+        statemsg = (
+            _(b'The repository is in an unfinished *%s* state.')
+            % self.unfinishedop
+        )
         fm.plain(b'%s\n' % _commentlines(statemsg), label=self._label)
 
         self._formatconflicts(fm)
         if self.unfinishedmsg:
-            fm.plain(b'%s\n' % _commentlines(self.unfinishedmsg),
-                     label=self._label)
+            fm.plain(
+                b'%s\n' % _commentlines(self.unfinishedmsg), label=self._label
+            )
 
     def _formatconflicts(self, fm):
         if not self.inmergestate:
@@ -809,8 +812,8 @@
         if self.unresolvedpaths:
             mergeliststr = b'\n'.join(
                 [
-                    b'    %s' % util.pathto(self.reporoot, encoding.getcwd(),
-                                            path)
+                    b'    %s'
+                    % util.pathto(self.reporoot, encoding.getcwd(), path)
                     for path in self.unresolvedpaths
                 ]
             )
@@ -841,8 +844,13 @@
     unresolved = None
     if mergestate.active():
         unresolved = sorted(mergestate.unresolved())
-    return morestatus(repo.root, unfinishedop, unfinishedmsg,
-                      unresolved is not None, unresolved)
+    return morestatus(
+        repo.root,
+        unfinishedop,
+        unfinishedmsg,
+        unresolved is not None,
+        unresolved,
+    )
 
 
 def findpossible(cmd, table, strict=False):
diff --git a/contrib/fuzz/mpatch_corpus.py b/contrib/fuzz/mpatch_corpus.py
--- a/contrib/fuzz/mpatch_corpus.py
+++ b/contrib/fuzz/mpatch_corpus.py
@@ -70,15 +70,15 @@
     # Manually constructed entries
     zf.writestr(
         "one_delta_applies",
-        bytes(corpus(b'a', [delta([deltafrag(0, 1, b'b')])]))
+        bytes(corpus(b'a', [delta([deltafrag(0, 1, b'b')])])),
     )
     zf.writestr(
         "one_delta_starts_late",
-        bytes(corpus(b'a', [delta([deltafrag(3, 1, b'b')])]))
+        bytes(corpus(b'a', [delta([deltafrag(3, 1, b'b')])])),
     )
     zf.writestr(
         "one_delta_ends_late",
-        bytes(corpus(b'a', [delta([deltafrag(0, 20, b'b')])]))
+        bytes(corpus(b'a', [delta([deltafrag(0, 20, b'b')])])),
     )
 
     try:



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list