Comments
Patch
@@ -1327,3 +1327,24 @@
printmessage=False, normallookup=True)
return result
+
+def cmdutilautocommit(orig, commandname, repo, commitfunc, **props):
+ if props.get('resuming', False):
+ # Even while automated committing, "_lfautocommit" attribute
+ # must not be created at the 1st commit of resuming.
+ # "_lfautocommit" attribute causes executing "Case 0" code
+ # path in "lfilesrepo.commit()", and may corrupt largefiles
+ # possibly modified manually before resuming.
+ wrapper = commitfunc
+ else:
+ def wrapper(*args, **kwargs):
+ # to detect unexpected nesting scope
+ assert not getattr(repo, '_lfautocommit', False)
+
+ repo._lfautocommit = commandname
+ try:
+ return commitfunc(*args, **kwargs)
+ finally:
+ repo._lfautocommit = False
+
+ return orig(commandname, repo, wrapper, **props)
@@ -124,6 +124,8 @@
overrides.hgsubrepoarchive)
extensions.wrapfunction(cmdutil, 'bailifchanged',
overrides.overridebailifchanged)
+ extensions.wrapfunction(cmdutil, 'autocommit',
+ overrides.cmdutilautocommit)
extensions.wrapfunction(scmutil, 'marktouched',
overrides.scmutilmarktouched)