diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -493,7 +493,7 @@ def docopy(ui, repo, pats, opts, wlock): # target: ossep def copy(origsrc, abssrc, relsrc, target, exact): abstarget = util.canonpath(repo.root, cwd, target) - reltarget = util.pathto(cwd, abstarget) + reltarget = util.pathto(repo.root, cwd, abstarget) prevsrc = targets.get(abstarget) if prevsrc is not None: ui.warn(_('%s: not overwriting - %s collides with %s\n') % @@ -2172,9 +2172,19 @@ def revert(ui, repo, *pats, **opts): # walk target manifest. + def badmatch(path): + if path in names: + return True + path_ = path + '/' + for f in names: + if f.startswith(path_): + return True + return False + for src, abs, rel, exact in cmdutil.walk(repo, pats, opts, node=node, - badmatch=names.has_key): - if abs in names: continue + badmatch=badmatch): + if abs in names or src == 'b': + continue names[abs] = (rel, exact) target_only[abs] = True @@ -2414,11 +2424,12 @@ def status(ui, repo, *pats, **opts): format = "%s %%s%s" % (char, end) for f in changes: - ui.write(format % util.pathto(cwd, f)) + ui.write(format % util.pathto(repo.root, cwd, f)) if ((all or opts.get('copies')) and not opts.get('no_status')): copied = repo.dirstate.copied(f) if copied: - ui.write(' %s%s' % (util.pathto(cwd, copied), end)) + ui.write(' %s%s' % (util.pathto(repo.root, cwd, copied), + end)) def tag(ui, repo, name, rev_=None, **opts): """add a tag for the current or given revision