using mercurial, I found the following behaviour:
#mkdir -p test_parent/test_child #cd test_parent #hg init #cd test_child #hg init #touch test #hg st ? test #cd .. #hg st *empty*
In other words, mercurial does not detect changes made in subdirectories which are also repositories.
Is this a documented feature, or expected behaviour?
I find this very useful at times and would like to be sure before using it for any projects of mine.
Thanks and kind regards
Initialize a new repository in the given directory. If the given directory does not exist, it will be created.
You are talking about two separate repositiories; that is the behaviour I would expect...
What I did not expect is that, even though the "parent" repository contains the "child", the "child" does not have to be ".hgignore"d...
Is anyone actually using this?
<Soapbox> You are exploring the unexpected behavior of a command while running as root? </soapbox>
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Like you, I have no idea what you are doing, but I am pretty sure it is wrong...Jasonwryan
How to Ask Questions the Smart Way
What I did not expect is that, even though the "parent"
repository contains the "child", the "child" does not have to be ".hgignore"d...
Is anyone actually using this?
I don't think that you should use the parent/child analogy, as it just confuses
the issue; while it may hold for the directory structure, once you have
initialized the new repository then—for all intents and purposes—they are
This comes in particularly handy when you 'hg qinit' inside an existing
@ewaller: just typed those commands from memory and put a # in front of them to distinguish commands from output. Did not think about # as root designator in PS1...
Here is the difference to hg qinit (or hg init --mq): this new repository "lives" inside the .hg directory, which is "ignored" by hg as it holds all revision information.
To rephrase my question: Is it expected that a repository in a subdirectory of a repository will be "ignored"? Or as you put it: Is it by design that they are - for all intents and purposes - separate repositories?
I ask as I don't remember comming across this info when reading the mercurial docs and tutorials.
Is it expected that a repository in a subdirectory of a repository will be "ignored"? Or as you put it: Is it by design that they are - for all intents and purposes - separate repositories
It is a design feature: if you have initialized multiple repos in the same directory and they were not completely separated then you would quickly descend into a mire of recursion...
Exactly my thoughts! Just wondered whether this was made explicit anywhere.
As I understand it, when you are in some directory, and type 'hg <something>'; hg will loke at the parent directories till it finds a .hg directory which holds repo info.
In contrast to for example subversion, where each directory holds it's own part of the repo as far as I understood.
Now as I see it, tracking changes stops when a subdirectory is hit which contains a '.hg' directory.
I wonder why this is not mentioned somewhere? :S
Thanks for your answers and putting up with me being insistent