obslog: provide successors and multiple markers to marker-displaying function
authorAnton Shestakov <av6@dwimlabs.net>
Tue, 25 Feb 2020 17:47:54 +0700
changeset 5172 52301aff269e
parent 5171 7f7f40cc6c9b
child 5173 dbbb48d93f18
obslog: provide successors and multiple markers to marker-displaying function
hgext3rd/evolve/obshistory.py
--- a/hgext3rd/evolve/obshistory.py	Tue Feb 18 18:16:11 2020 +0800
+++ b/hgext3rd/evolve/obshistory.py	Tue Feb 25 17:47:54 2020 +0700
@@ -180,7 +180,8 @@
                 succs = sorted(succs)
 
                 for successor in succs:
-                    _debugobshistorydisplaymarker(self.ui, markerfm, successor,
+                    _debugobshistorydisplaymarker(self.ui, markerfm,
+                                                  successor[1], [successor],
                                                   ctx.node(), self.repo,
                                                   self._includediff)
 
@@ -458,7 +459,7 @@
         markerfm = fm.nested(b"markers")
         for successor in sorted(succs):
             includediff = opts and opts.get("patch")
-            _debugobshistorydisplaymarker(ui, markerfm, successor, ctxnode, unfi, includediff)
+            _debugobshistorydisplaymarker(ui, markerfm, successor[1], [successor], ctxnode, unfi, includediff)
         markerfm.end()
         fm.plain(b'\n')
 
@@ -501,16 +502,14 @@
              label=b"evolve.node evolve.missing_change_ctx")
     fm.plain(b'\n')
 
-def _debugobshistorydisplaymarker(ui, fm, marker, node, repo, includediff=False):
-    succnodes = marker[1]
-
+def _debugobshistorydisplaymarker(ui, fm, succnodes, markers, node, repo, includediff=False):
     fm.startitem()
 
-    verb = _successorsetverb(succnodes, [marker])[b"verb"]
+    verb = _successorsetverb(succnodes, markers)[b"verb"]
 
     fm.data(verb=verb)
 
-    effects = _markerseffects([marker])
+    effects = _markerseffects(markers)
     if effects:
         fmteffects = fm.formatlist(effects, b'effect', sep=b', ')
         fm.data(effects=fmteffects)
@@ -521,26 +520,26 @@
         fm.data(succnodes=nodes)
 
     # Operations
-    operations = obsutil.markersoperations([marker])
+    operations = obsutil.markersoperations(markers)
     if operations:
         fm.data(operations=fm.formatlist(operations, name=b'operation', sep=b', '))
 
     # Users
-    users = obsutil.markersusers([marker])
+    users = obsutil.markersusers(markers)
     fm.data(users=fm.formatlist(users, name=b'user', sep=b', '))
 
     # Dates
-    dates = obsutil.markersdates([marker])
+    dates = obsutil.markersdates(markers)
     fm.data(dates=fm.formatlist(dates, name=b'date'))
 
     # Notes
-    notes = _markersnotes([marker])
+    notes = _markersnotes(markers)
     if notes:
         fm.data(notes=fm.formatlist(notes, name=b'note', sep=b'\n'))
 
     # Patch display
     if includediff is True:
-        _patchavailable = patchavailable(node, repo, marker[1])
+        _patchavailable = patchavailable(node, repo, succnodes)
 
         if _patchavailable[0] is True:
             succ = _patchavailable[1]