mercurial/revlog.py
changeset 32307 3caec778774b
parent 32291 bd872f64a8ba
child 32315 67026d65a4fc
--- a/mercurial/revlog.py	Wed May 17 23:01:56 2017 +0900
+++ b/mercurial/revlog.py	Wed May 17 20:14:27 2017 -0700
@@ -252,7 +252,7 @@
     If checkambig, indexfile is opened with checkambig=True at
     writing, to avoid file stat ambiguity.
     """
-    def __init__(self, opener, indexfile, checkambig=False):
+    def __init__(self, opener, indexfile, datafile=None, checkambig=False):
         """
         create a revlog object
 
@@ -260,7 +260,7 @@
         and can be used to implement COW semantics or the like.
         """
         self.indexfile = indexfile
-        self.datafile = indexfile[:-2] + ".d"
+        self.datafile = datafile or (indexfile[:-2] + ".d")
         self.opener = opener
         #  When True, indexfile is opened with checkambig=True at writing, to
         #  avoid file stat ambiguity.