Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 14443:6fe6defdc924
subrepo: refactor writestate for clarity
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Fri, 27 May 2011 11:01:44 +0200 |
parents | 96f1c1b14154 |
children | b2ee161328e0 |
comparison
equal
deleted
inserted
replaced
14442:5b48ad1e7f1a | 14443:6fe6defdc924 |
---|---|
77 | 77 |
78 return state | 78 return state |
79 | 79 |
80 def writestate(repo, state): | 80 def writestate(repo, state): |
81 """rewrite .hgsubstate in (outer) repo with these subrepo states""" | 81 """rewrite .hgsubstate in (outer) repo with these subrepo states""" |
82 repo.wwrite('.hgsubstate', | 82 lines = ['%s %s\n' % (state[s][1], s) for s in sorted(state)] |
83 ''.join(['%s %s\n' % (state[s][1], s) | 83 repo.wwrite('.hgsubstate', ''.join(lines), '') |
84 for s in sorted(state)]), '') | |
85 | 84 |
86 def submerge(repo, wctx, mctx, actx, overwrite): | 85 def submerge(repo, wctx, mctx, actx, overwrite): |
87 """delegated from merge.applyupdates: merging of .hgsubstate file | 86 """delegated from merge.applyupdates: merging of .hgsubstate file |
88 in working context, merging context and ancestor context""" | 87 in working context, merging context and ancestor context""" |
89 if mctx == actx: # backwards? | 88 if mctx == actx: # backwards? |