bookmarks and branches again: files
David Demelier
demelier.david at gmail.com
Tue Jul 19 09:34:00 UTC 2016
Le 12/07/2016 16:07, Uwe Brauer a écrit :
> > On Tue, Jul 12, 2016 at 2:31 PM, Uwe Brauer <oub at mat.ucm.es> wrote:
>
>
> > So when you executed "hg update default", mercurial interpreted that
> > to mean "update to the latest revision on the branch 'default'", which
> > happens to be the same commit pointed at by your "master" bookmark. In
> > other words, "hg update default" didn't move you to a different
> > revision, all it did was deactivate your active bookmark.
>
> > In mercurial, all commits are part of a named branch, even if you are
> > using bookmarks. If you haven't used "hg branch" at all, then all
> > commits are part of the branch called "default".
>
> Ok I see that is important to know.
>
> It seem that the following producing something similar with bookmarks
> (to the branch case)
>
> hg init
> hg bookmark master
> echo one > test1.txt
> hg add test1.txt
> hg commit -m "0"
> hg bookmark book2
> hg update book2
> echo two >> test2.txt
> hg add test2.txt
> hg commit -m "1"
> echo three >> test1.txt
> hg commit -m "2"
> hg update master
> echo four >> test1.txt
> hg commit -m "3"
>
>
> So the idea is to use two bookmarks instead of only one, so
Exactly, but we recommend using @ as a default bookmark as it is
activated by default in new clones.
A bookmark named '@' has the special property that 'hg clone' will
check
it out by default if it exists.
Also, always use the 'hg log -G' command, it will help you a lot
discovering what happens in your repository.
Regards,
--
David Demelier
More information about the Mercurial
mailing list