comparison mercurial/commands.py @ 18961:cd1ac2e54847

debugrebuildstate: clarify that rev can't be specified without -r -r has a default value of '' in the command line. The function default value of 'tip' is thus never used and any attempt at specifying revisions without -r will fail. It seems like then intended behavior was that 'hg debugrebuildstate' without any parameters should set the parents to tip. That would be very confusing now when the command primarily is used to recover from incorrect stat info. It is apparently undocumented that '' is the same as '.' ... unless it is passed in a place where revsets are used.
author Mads Kiilerich <madski@unity3d.com>
date Mon, 15 Apr 2013 01:39:02 +0200
parents 1a9ad84583ee
children c0b2cb62067f
comparison
equal deleted inserted replaced
18960:170fc0949fb6 18961:cd1ac2e54847
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: