Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
Y:\>hg -R Y:/mercFlow.cache/vm-linux rename Migration-2010/create_directory_stru
cture.pl Migration-2010/create_directory_structure.pl2
abort: Migration-2010/create_directory_structure.pl not under root

I am in windows using Mercurial. I am trying to rename\move a file as a simple test. Y:/mercFlow.cache/vm-linx/Migration-2010/create_directory_structure.pl exists and is brow-sable in the file browser. Migration-2010/create_directory_Structure.pl most definitely does seem to exist under the vm-linux local repository.

What's going wrong here?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

You need to use paths relative to your current working directory when you use hg -R -- that is, the -R option does not change the working directory of the hg proceess. The --cwd option does change the working directory.

This illustrates the difference:

$ hg init test
$ echo hello > test/hello.txt
$ hg -R test add test/hello.txt
$ hg -R test status test/hello.txt
A test/hello.txt
$ hg --cwd test status hello.txt
A hello.txt

and this does not work:

$ hg -R test status hello.txt
abort: hello.txt not under root
$ hg --cwd test status test/hello.txt
test/hello.txt: No such file or directory
share|improve this answer
Pitty there's no mention of this at selenic.com/mercurial/hg.1.html#options –  Piotr Dobrogost Feb 14 at 12:52
@PiotrDobrogost: It's a little implicit now, yes. Maybe you could submit a patch with better help strings for the options? Please see mercurial.selenic.com/wiki/ContributingChanges. –  Martin Geisler Feb 14 at 13:13

is Migration-2010/create_directory_structure.pl under version control? It has to be in your Mercurial repository before you can manipulate it with Mercurial.

share|improve this answer
Yes it is under Version Control. –  Joshua Enfield Jul 27 '10 at 20:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.