D7831: changelog: fix the diverted opener to accept more kwargs

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Mon Jan 13 09:19:45 EST 2020


Closed by commit rHG7f67f53492f7: changelog: fix the diverted opener to accept more kwargs (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7831?vs=19151&id=19166

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

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

AFFECTED FILES
  mercurial/changelog.py

CHANGE DETAILS

diff --git a/mercurial/changelog.py b/mercurial/changelog.py
--- a/mercurial/changelog.py
+++ b/mercurial/changelog.py
@@ -167,10 +167,10 @@
 def _divertopener(opener, target):
     """build an opener that writes in 'target.a' instead of 'target'"""
 
-    def _divert(name, mode=b'r', checkambig=False):
+    def _divert(name, mode=b'r', checkambig=False, **kwargs):
         if name != target:
-            return opener(name, mode)
-        return opener(name + b".a", mode)
+            return opener(name, mode, **kwargs)
+        return opener(name + b".a", mode, **kwargs)
 
     return _divert
 
@@ -178,9 +178,10 @@
 def _delayopener(opener, target, buf):
     """build an opener that stores chunks in 'buf' instead of 'target'"""
 
-    def _delay(name, mode=b'r', checkambig=False):
+    def _delay(name, mode=b'r', checkambig=False, **kwargs):
         if name != target:
-            return opener(name, mode)
+            return opener(name, mode, **kwargs)
+        assert not kwargs
         return appender(opener, name, mode, buf)
 
     return _delay



To: marmoute, #hg-reviewers, pulkit
Cc: mercurial-devel


More information about the Mercurial-devel mailing list