[PATCH 1 of 7] transaction: accept a 'location' argument for registertmp

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Nov 18 23:39:58 UTC 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1415804261 0
#      Wed Nov 12 14:57:41 2014 +0000
# Node ID 2589c851a997c896958803be48accd64ca30c674
# Parent  e63941631a3f61b3323dbcc2545689b1eb34e308
transaction: accept a 'location' argument for registertmp

This will allow generation of temporary file outside of store. This will be
useful for bookmarks.

diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -223,17 +223,17 @@ class transaction(object):
         self._backupmap[file] = len(self._backupentries) - 1
         self._backupsfile.write("%s\0%s\0%s\0%d\n" % entry)
         self._backupsfile.flush()
 
     @active
-    def registertmp(self, tmpfile):
+    def registertmp(self, tmpfile, location=''):
         """register a temporary transaction file
 
         Such file will be delete when the transaction exit (on both failure and
         success).
         """
-        self._addbackupentry(('', '', tmpfile, False))
+        self._addbackupentry((location, '', tmpfile, False))
 
     @active
     def addfilegenerator(self, genid, filenames, genfunc, order=0,
                          location=''):
         """add a function to generates some files at transaction commit


More information about the Mercurial-devel mailing list