Patchwork [3,of,5] exchange: replace references to 'sopener' with 'svfs'

login
register
mail settings
Submitter Siddharth Agarwal
Date June 26, 2015, 5:24 a.m.
Message ID <edc7bbd277fd0c8f65a9.1435296250@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/9787/
State Accepted
Headers show

Comments

Siddharth Agarwal - June 26, 2015, 5:24 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1435295936 25200
#      Thu Jun 25 22:18:56 2015 -0700
# Node ID edc7bbd277fd0c8f65a93a19c020adbd2d0575bd
# Parent  438c204ed884e6e349e5ea0a1bff6ed17f58797c
exchange: replace references to 'sopener' with 'svfs'

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1484,10 +1484,10 @@  def generatestreamclone(repo):
                   (len(entries), total_bytes))
     yield '%d %d\n' % (len(entries), total_bytes)
 
-    sopener = repo.svfs
-    oldaudit = sopener.mustaudit
+    svfs = repo.svfs
+    oldaudit = svfs.mustaudit
     debugflag = repo.ui.debugflag
-    sopener.mustaudit = False
+    svfs.mustaudit = False
 
     try:
         for name, size in entries:
@@ -1496,17 +1496,17 @@  def generatestreamclone(repo):
             # partially encode name over the wire for backwards compat
             yield '%s\0%d\n' % (store.encodedir(name), size)
             if size <= 65536:
-                fp = sopener(name)
+                fp = svfs(name)
                 try:
                     data = fp.read(size)
                 finally:
                     fp.close()
                 yield data
             else:
-                for chunk in util.filechunkiter(sopener(name), limit=size):
+                for chunk in util.filechunkiter(svfs(name), limit=size):
                     yield chunk
     finally:
-        sopener.mustaudit = oldaudit
+        svfs.mustaudit = oldaudit
 
 def consumestreamclone(repo, fp):
     """Apply the contents from a streaming clone file.