diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -1318,45 +1318,37 @@ def mergeupdate(orig, repo, node, branch # (*) don't care # (*1) deprecated, but used internally (e.g: "rebase --collapse") - linearmerge = not branchmerge and not force and not partial + lfdirstate = lfutil.openlfdirstate(repo.ui, repo) + unsure, s = lfdirstate.status(match_.always(repo.root, + repo.getcwd()), + [], False, False, False) + pctx = repo['.'] + for lfile in unsure + s.modified: + lfileabs = repo.wvfs.join(lfile) + if not os.path.exists(lfileabs): + continue + lfhash = lfutil.hashrepofile(repo, lfile) + standin = lfutil.standin(lfile) + lfutil.writestandin(repo, standin, lfhash, + lfutil.getexecutable(lfileabs)) + if (standin in pctx and + lfhash == lfutil.readstandin(repo, lfile, '.')): + lfdirstate.normal(lfile) + for lfile in s.added: + lfutil.updatestandin(repo, lfutil.standin(lfile)) + lfdirstate.write() - if linearmerge or (branchmerge and force and not partial): - # update standins for linear-merge or force-branch-merge, - # because largefiles in the working directory may be modified - lfdirstate = lfutil.openlfdirstate(repo.ui, repo) - unsure, s = lfdirstate.status(match_.always(repo.root, - repo.getcwd()), - [], False, False, False) - pctx = repo['.'] - for lfile in unsure + s.modified: - lfileabs = repo.wvfs.join(lfile) - if not os.path.exists(lfileabs): - continue - lfhash = lfutil.hashrepofile(repo, lfile) - standin = lfutil.standin(lfile) - lfutil.writestandin(repo, standin, lfhash, - lfutil.getexecutable(lfileabs)) - if (standin in pctx and - lfhash == lfutil.readstandin(repo, lfile, '.')): - lfdirstate.normal(lfile) - for lfile in s.added: - lfutil.updatestandin(repo, lfutil.standin(lfile)) - lfdirstate.write() - - if linearmerge: - # Only call updatelfiles on the standins that have changed - # to save time - oldstandins = lfutil.getstandinsstate(repo) + oldstandins = lfutil.getstandinsstate(repo) result = orig(repo, node, branchmerge, force, partial, *args, **kwargs) - filelist = None - if linearmerge: - newstandins = lfutil.getstandinsstate(repo) - filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) + newstandins = lfutil.getstandinsstate(repo) + filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) + if branchmerge or force or partial: + filelist.extend(s.deleted + s.removed) lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, - normallookup=partial, checked=linearmerge) + normallookup=partial, checked=True) return result finally: diff --git a/tests/test-issue3084.t b/tests/test-issue3084.t --- a/tests/test-issue3084.t +++ b/tests/test-issue3084.t @@ -113,8 +113,6 @@ Largefile in the working copy, keeping t $ echo "l" | hg merge --config ui.interactive=Yes remote turned local largefile foo into a normal file keep (l)argefile or use (n)ormal file? l - getting changed largefiles - 0 largefiles updated, 0 removed 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) @@ -249,8 +247,6 @@ swap $ hg up -Cqr large $ hg merge -r normal-id - getting changed largefiles - 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f @@ -271,8 +267,6 @@ swap $ hg up -Cqr large $ hg merge -r normal-same - getting changed largefiles - 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f @@ -307,8 +301,6 @@ swap $ hg merge -r normal2 remote turned local largefile f into a normal file keep (l)argefile or use (n)ormal file? l - getting changed largefiles - 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f @@ -372,8 +364,6 @@ Ancestor: large Parent: large2 Paren $ hg merge -r normal remote turned local largefile f into a normal file keep (l)argefile or use (n)ormal file? l - getting changed largefiles - 0 largefiles updated, 0 removed 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f diff --git a/tests/test-largefiles-misc.t b/tests/test-largefiles-misc.t --- a/tests/test-largefiles-misc.t +++ b/tests/test-largefiles-misc.t @@ -364,8 +364,6 @@ Test update with subrepos. $ hg update -C getting changed largefiles 1 largefiles updated, 0 removed - getting changed largefiles - 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg status -S @@ -805,8 +803,6 @@ merge action 'd' for 'local renamed dire R d1/f $ hg merge merging d2/f and d1/f to d2/f - getting changed largefiles - 0 largefiles updated, 0 removed 1 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cd .. diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t --- a/tests/test-largefiles.t +++ b/tests/test-largefiles.t @@ -581,8 +581,6 @@ Test 3507 (both normal files and largefi C sub2/large6 C sub2/large7 $ hg up -C '.^' - getting changed largefiles - 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg remove large $ hg addremove --traceback @@ -1431,8 +1429,6 @@ Rollback on largefiles. verify that largefile .orig file no longer is overwritten on every update -C: $ hg update --clean - getting changed largefiles - 0 largefiles updated, 0 removed 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat sub2/large7.orig mistake