how can you tell you have merged?

Bill Barry after.fallout at gmail.com
Thu Sep 11 13:38:22 CDT 2008


Matt Mackall wrote:
> On Thu, 2008-09-11 at 02:15 -0400, Douglas Philips wrote:
>> hg parents
>>     
>
> There is apparently a large flaw in our documentation such that many
> users are unaware of this essential basic command. It should be one of
> the first concepts they learn. How do we fix it?
>
>   
I think the flaw is more basic than this missing command. The command is 
documented and the documentation makes a lot of sense when you already 
know what you are doing. I think the problem is that people think of 
their working copy being a specific revision (when really the working 
copy is sorta the "next" revision that isn't committed yet). When I 
first asked one of my coworkers what he thought hg parents did (I 
noticed he never used it where I would during a pairing session), he 
said it gave the parents of the revision your working copy is at, so if 
you had:
@   - 4
| \
|  o - 3
|  |
o |  - 2
| /
o   - 1


He expected "hg parents" to say 3 and 2 (and "hg id" to be 4, because it 
is the revision the repository is "at"). Unfortunately, such a command 
is pretty much useless, and so he had never used it (this is why the 
command doesn't actually do that; I can't think of any reason the 
parents' parents should be such a simple command). Continuing this 
thought process, he would expect hg id to give two revisions when an 
uncommitted merge exists (which it indeed does do).

So the problem is that people expect "hg parents" to provide the parent 
revision number of the revision they are "at", when really the working 
copy isn't "at" any revision at all, it is the not-yet-recognized child 
of a parent (or two).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://selenic.com/pipermail/mercurial/attachments/20080911/92348bab/attachment.htm 


More information about the Mercurial mailing list