# HG changeset patch # User Martin Geisler # Date 2011-05-27 09:01:44 # Node ID 6fe6defdc924d4ac9f0cbe97f2afd5b97b6e5c1e # Parent 5b48ad1e7f1a0bb6e408993d50eb8959255834ea subrepo: refactor writestate for clarity diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -79,9 +79,8 @@ def state(ctx, ui): def writestate(repo, state): """rewrite .hgsubstate in (outer) repo with these subrepo states""" - repo.wwrite('.hgsubstate', - ''.join(['%s %s\n' % (state[s][1], s) - for s in sorted(state)]), '') + lines = ['%s %s\n' % (state[s][1], s) for s in sorted(state)] + repo.wwrite('.hgsubstate', ''.join(lines), '') def submerge(repo, wctx, mctx, actx, overwrite): """delegated from merge.applyupdates: merging of .hgsubstate file