largefiles: remove the second `changing_parents` in `updatelfiles`
Now that the `update_file` call have been migrated, we can drop the
semantically-wrong `changing_parents` context.
--- a/hgext/largefiles/lfcommands.py Wed Feb 15 00:55:44 2023 +0100
+++ b/hgext/largefiles/lfcommands.py Wed Feb 15 00:57:16 2023 +0100
@@ -579,43 +579,42 @@
statuswriter(_(b'getting changed largefiles\n'))
cachelfiles(ui, repo, None, lfiles)
- with lfdirstate.changing_parents(repo):
- for lfile in lfiles:
- update1 = 0
+ for lfile in lfiles:
+ update1 = 0
- expecthash = update.get(lfile)
- if expecthash:
- if not lfutil.copyfromcache(repo, expecthash, lfile):
- # failed ... but already removed and set to normallookup
- continue
- # Synchronize largefile dirstate to the last modified
- # time of the file
- lfdirstate.hacky_extension_update_file(
- lfile,
- p1_tracked=True,
- wc_tracked=True,
- )
+ expecthash = update.get(lfile)
+ if expecthash:
+ if not lfutil.copyfromcache(repo, expecthash, lfile):
+ # failed ... but already removed and set to normallookup
+ continue
+ # Synchronize largefile dirstate to the last modified
+ # time of the file
+ lfdirstate.hacky_extension_update_file(
+ lfile,
+ p1_tracked=True,
+ wc_tracked=True,
+ )
+ update1 = 1
+
+ # copy the exec mode of largefile standin from the repository's
+ # dirstate to its state in the lfdirstate.
+ standin = lfutil.standin(lfile)
+ if wvfs.exists(standin):
+ # exec is decided by the users permissions using mask 0o100
+ standinexec = wvfs.stat(standin).st_mode & 0o100
+ st = wvfs.stat(lfile)
+ mode = st.st_mode
+ if standinexec != mode & 0o100:
+ # first remove all X bits, then shift all R bits to X
+ mode &= ~0o111
+ if standinexec:
+ mode |= (mode >> 2) & 0o111 & ~util.umask
+ wvfs.chmod(lfile, mode)
update1 = 1
- # copy the exec mode of largefile standin from the repository's
- # dirstate to its state in the lfdirstate.
- standin = lfutil.standin(lfile)
- if wvfs.exists(standin):
- # exec is decided by the users permissions using mask 0o100
- standinexec = wvfs.stat(standin).st_mode & 0o100
- st = wvfs.stat(lfile)
- mode = st.st_mode
- if standinexec != mode & 0o100:
- # first remove all X bits, then shift all R bits to X
- mode &= ~0o111
- if standinexec:
- mode |= (mode >> 2) & 0o111 & ~util.umask
- wvfs.chmod(lfile, mode)
- update1 = 1
+ updated += update1
- updated += update1
-
- lfutil.synclfdirstate(repo, lfdirstate, lfile, normallookup)
+ lfutil.synclfdirstate(repo, lfdirstate, lfile, normallookup)
lfdirstate.write(repo.currenttransaction())
if lfiles: