diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py +++ b/hgext/largefiles/lfcommands.py @@ -443,6 +443,7 @@ def updatelfiles(ui, repo, filelist=None lfiles = set(lfutil.listlfiles(repo)) | set(lfdirstate) if filelist is not None: + filelist = set(filelist) lfiles = [f for f in lfiles if f in filelist] update = {} @@ -512,6 +513,19 @@ def updatelfiles(ui, repo, filelist=None lfutil.synclfdirstate(repo, lfdirstate, lfile, normallookup) + if filelist is not None: + # If "local largefile" is chosen at file merging, it is + # not listed in "filelist" (= dirstate syncing is + # omitted), because the standin file is not changed before and + # after merging. + # But the status of such files may have to be changed by + # merging. For example, locally modified ("M") largefile + # has to become re-added("A"), if it is "normal" file in + # the target revision of linear-merging. + for lfile in lfdirstate: + if lfile not in filelist: + lfutil.synclfdirstate(repo, lfdirstate, lfile, True) + lfdirstate.write() if printmessage and lfiles: ui.status(_('%d largefiles updated, %d removed\n') % (updated, diff --git a/tests/test-largefiles-update.t b/tests/test-largefiles-update.t --- a/tests/test-largefiles-update.t +++ b/tests/test-largefiles-update.t @@ -247,6 +247,8 @@ Test a linear merge to a revision contai $ hg debugdirstate --nodates | grep large2 a 0 -1 .hglf/large2 r 0 0 large2 + $ hg status -A large2 + A large2 $ cat large2 modified large2 for linear merge @@ -261,6 +263,8 @@ Test a linear merge to a revision contai $ hg debugdirstate --nodates | grep large3 a 0 -1 .hglf/large3 r 0 0 large3 + $ hg status -A large3 + A large3 $ cat large3 large3 as large file for linear merge