2246 (abs(pa._depth - pb._depth), pvec._hamming(pa._vec, pb._vec), |
2246 (abs(pa._depth - pb._depth), pvec._hamming(pa._vec, pb._vec), |
2247 pa.distance(pb), rel)) |
2247 pa.distance(pb), rel)) |
2248 |
2248 |
2249 @command('debugrebuildstate', |
2249 @command('debugrebuildstate', |
2250 [('r', 'rev', '', _('revision to rebuild to'), _('REV'))], |
2250 [('r', 'rev', '', _('revision to rebuild to'), _('REV'))], |
2251 _('[-r REV] [REV]')) |
2251 _('[-r REV]')) |
2252 def debugrebuildstate(ui, repo, rev="tip"): |
2252 def debugrebuildstate(ui, repo, rev): |
2253 """rebuild the dirstate as it would look like for the given revision""" |
2253 """rebuild the dirstate as it would look like for the given revision |
|
2254 |
|
2255 If no revision is specified the first current parent will be used. |
|
2256 |
|
2257 The dirstate will be set to the files of the given revision. |
|
2258 The actual working directory content or existing dirstate |
|
2259 information such as adds or removes is not considered. |
|
2260 |
|
2261 One use of this command is to make the next :hg:`status` invocation |
|
2262 check the actual file content. |
|
2263 """ |
2254 ctx = scmutil.revsingle(repo, rev) |
2264 ctx = scmutil.revsingle(repo, rev) |
2255 wlock = repo.wlock() |
2265 wlock = repo.wlock() |
2256 try: |
2266 try: |
2257 repo.dirstate.rebuild(ctx.node(), ctx.manifest()) |
2267 repo.dirstate.rebuild(ctx.node(), ctx.manifest()) |
2258 finally: |
2268 finally: |