Patchwork D6034: absorb: use scmutil.cleanupnodes() so operation gets set

login
register
mail settings
Submitter phabricator
Date Feb. 28, 2019, 12:22 a.m.
Message ID <differential-rev-PHID-DREV-532qi7rxu4ymquiuho63-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/38956/
State Superseded
Headers show

Comments

phabricator - Feb. 28, 2019, 12:22 a.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The operation is useful for e.g. `hg obslog` output.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/absorb.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/absorb.py b/hgext/absorb.py
--- a/hgext/absorb.py
+++ b/hgext/absorb.py
@@ -860,10 +860,10 @@ 
         return obsolete.isenabled(self.repo, obsolete.createmarkersopt)
 
     def _obsoleteoldcommits(self):
-        relations = [(self.repo[k], v and (self.repo[v],) or ())
-                     for k, v in self.replacemap.iteritems()]
-        if relations:
-            obsolete.createmarkers(self.repo, relations)
+        replacements = {k: ([v] if v is not None else [])
+                        for k, v in self.replacemap.iteritems()}
+        if replacements:
+            scmutil.cleanupnodes(self.repo, replacements, operation='absorb')
 
     def _stripoldcommits(self):
         nodelist = self.replacemap.keys()