Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
Y:\>hg -R Y:/mercFlow.cache/vm-linux rename Migration-2010/create_directory_stru Migration-2010/create_directory_structure.pl2
abort: Migration-2010/ 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/ exists and is brow-sable in the file browser. Migration-2010/ most definitely does seem to exist under the vm-linux local repository.

What's going wrong here?

share|improve this question
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 – Piotr Dobrogost Feb 14 '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 – Martin Geisler Feb 14 '14 at 13:13

is Migration-2010/ 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.