shelve: open patch using new shelf class instead of open()
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 07 Jan 2021 15:24:15 -0800
changeset 46279 14ce2eb6e8a4
parent 46278 58ca94869287
child 46280 7e300d297547
shelve: open patch using new shelf class instead of open() For some reason the existing code didn't use `shelvedfile().opener()` so here we migrate to `shelf().open_patch()` from the `open()` system call instead. Differential Revision: https://phab.mercurial-scm.org/D9706
mercurial/shelve.py
--- a/mercurial/shelve.py	Thu Jan 07 14:48:57 2021 -0800
+++ b/mercurial/shelve.py	Thu Jan 07 15:24:15 2021 -0800
@@ -28,7 +28,6 @@
 import stat
 
 from .i18n import _
-from .pycompat import open
 from .node import (
     bin,
     hex,
@@ -672,7 +671,7 @@
         ui.write(age, label=b'shelve.age')
         ui.write(b' ' * (12 - len(age)))
         used += 12
-        with open(name + b'.' + patchextension, b'rb') as fp:
+        with Shelf(repo, sname).open_patch() as fp:
             while True:
                 line = fp.readline()
                 if not line: