diff --git a/hgext/record.py b/hgext/record.py --- a/hgext/record.py +++ b/hgext/record.py @@ -363,7 +363,7 @@ def record(ui, repo, *pats, **opts): try: for realname, tmpname in backups.iteritems(): ui.debug('restoring %r to %r\n' % (tmpname, realname)) - util.copyfile(tmpname, realname) + util.copyfile(tmpname, repo.wjoin(realname)) os.unlink(tmpname) os.rmdir(backupdir) except OSError: diff --git a/tests/test-record b/tests/test-record --- a/tests/test-record +++ b/tests/test-record @@ -202,3 +202,15 @@ y y EOF echo; hg tip -p + +mkdir subdir +cd subdir +echo a > a +hg ci -d '16 0' -Amsubdir + +echo a >> a +hg record -d '16 0' -m subdir-change a <