##// END OF EJS Templates
dirstate: distinct transaction callback from largefile...
marmoute -
r51403:4e95341c default
parent child Browse files
Show More
@@ -160,6 +160,7 b' def findfile(repo, hash):'
160
160
161 class largefilesdirstate(dirstate.dirstate):
161 class largefilesdirstate(dirstate.dirstate):
162 _large_file_dirstate = True
162 _large_file_dirstate = True
163 _tr_key_suffix = b'-large-files'
163
164
164 def __getitem__(self, key):
165 def __getitem__(self, key):
165 return super(largefilesdirstate, self).__getitem__(unixpath(key))
166 return super(largefilesdirstate, self).__getitem__(unixpath(key))
@@ -133,6 +133,10 b' CHANGE_TYPE_FILES = "files"'
133
133
134 @interfaceutil.implementer(intdirstate.idirstate)
134 @interfaceutil.implementer(intdirstate.idirstate)
135 class dirstate:
135 class dirstate:
136
137 # used by largefile to avoid overwritting transaction callbacK
138 _tr_key_suffix = b''
139
136 def __init__(
140 def __init__(
137 self,
141 self,
138 opener,
142 opener,
@@ -951,7 +955,10 b' class dirstate:'
951
955
952 # make sure we invalidate the current change on abort
956 # make sure we invalidate the current change on abort
953 if tr is not None:
957 if tr is not None:
954 tr.addabort(b'dirstate-invalidate', on_abort)
958 tr.addabort(
959 b'dirstate-invalidate%s' % self._tr_key_suffix,
960 on_abort,
961 )
955
962
956 self._attached_to_a_transaction = True
963 self._attached_to_a_transaction = True
957
964
@@ -961,7 +968,7 b' class dirstate:'
961
968
962 # delay writing in-memory changes out
969 # delay writing in-memory changes out
963 tr.addfilegenerator(
970 tr.addfilegenerator(
964 b'dirstate-1-main',
971 b'dirstate-1-main%s' % self._tr_key_suffix,
965 (self._filename,),
972 (self._filename,),
966 on_success,
973 on_success,
967 location=b'plain',
974 location=b'plain',
@@ -969,7 +976,7 b' class dirstate:'
969 )
976 )
970 if write_key:
977 if write_key:
971 tr.addfilegenerator(
978 tr.addfilegenerator(
972 b'dirstate-2-key-post',
979 b'dirstate-2-key-post%s' % self._tr_key_suffix,
973 (self._filename_th,),
980 (self._filename_th,),
974 lambda f: self._write_tracked_hint(tr, f),
981 lambda f: self._write_tracked_hint(tr, f),
975 location=b'plain',
982 location=b'plain',
General Comments 0
You need to be logged in to leave comments. Login now