diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py --- a/hgext/narrow/narrowcommands.py +++ b/hgext/narrow/narrowcommands.py @@ -433,7 +433,7 @@ def trackedcmd(ui, repo, remotepath=None if update_working_copy: with repo.wlock(), repo.lock(), repo.transaction('narrow-wc') as tr: - narrowspec.updateworkingcopy(repo, tr) + narrowspec.updateworkingcopy(repo) narrowspec.copytoworkingcopy(repo, tr) return 0 diff --git a/mercurial/narrowspec.py b/mercurial/narrowspec.py --- a/mercurial/narrowspec.py +++ b/mercurial/narrowspec.py @@ -266,7 +266,7 @@ def checkworkingcopynarrowspec(repo): raise error.Abort(_("working copy's narrowspec is stale"), hint=_("run 'hg tracked --update-working-copy'")) -def updateworkingcopy(repo, tr): +def updateworkingcopy(repo): oldspec = repo.vfs.tryread(DIRSTATE_FILENAME) newspec = repo.svfs.tryread(FILENAME) @@ -294,5 +294,3 @@ def updateworkingcopy(repo, tr): for f in newfiles: ds.normallookup(f) _writeaddedfiles(repo, pctx, newfiles) - - ds.write(tr)