Please help with Mercurial Bookmarks workflow

View: New views
13 Messages — Rating Filter:   Alert me  

Please help with Mercurial Bookmarks workflow

by amaslov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

  I have been using local branches in git, maybe this breaks my attempts to master hg bookmarks...

  With Mercurial 1.2.1 I do the following:
1) create a repository (let's call it "repo1"), add a file "file1.txt" there, commit it
2) clone the repository (let's call this one "repo2"), add bookmarks extension and "track.current = True" under "[bookmarks]" to hgrc, create bookmarks "master" and "quickfix" there
3) at repo2: "hg up -C quickfix", change the file "file1.txt", commit it
4) at repo2: switch to master: "hg up -C master", hg out - and see that the changes to "file1.txt" are propagated into push.

  I expected that only changes to the branch I am on are propagated into push. Is it an expected behavior?

  I am not very proficient with Mercurial and sorry for any stupidity I have written.

  Thanks a lot for help!

Regards,
  Alexey

Re: Please help with Mercurial Bookmarks workflow

by Martin Geisler-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

amaslov <amaslov.p@...> writes:

> Hello,
>
>   I have been using local branches in git, maybe this breaks my attempts to
> master hg bookmarks...
>
>   With Mercurial 1.2.1 I do the following:
> 1) create a repository (let's call it "repo1"), add a file "file1.txt"
> there, commit it
> 2) clone the repository (let's call this one "repo2"), add bookmarks
> extension and "track.current = True" under "[bookmarks]" to hgrc, create
> bookmarks "master" and "quickfix" there
> 3) at repo2: "hg up -C quickfix", change the file "file1.txt", commit it
> 4) at repo2: switch to master: "hg up -C master", hg out - and see that the
> changes to "file1.txt" are propagated into push.
>
>   I expected that only changes to the branch I am on are propagated
> into push. Is it an expected behavior?
Yes, sort of -- push/pull simply move any missing changesets between
repositories. If you want to move only some revisions you can use the -r
flag to them (and to outgoing too).

I haven't tried, but I would guess that 'hg outgoing -r master' would
show only new changesets on your branch.

--
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.


_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

attachment0 (202 bytes) Download Attachment

Re: Please help with Mercurial Bookmarks workflow

by willie-28 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

If you want to push changesets which you considered 'complete', I also
recommend you give the 'task' extension a try:

http://www.selenic.com/mercurial/wiki/index.cgi/TasksExtension

This extension not only provides the functions which similar to
bookmarks, but also has built-in stash which could automatically save
your current changes in working directory (yes, just like git stash).

Sincerely yours,

Willie

On Fri, Apr 10, 2009 at 7:24 PM, amaslov <amaslov.p@...> wrote:

>
> Hello,
>
>  I have been using local branches in git, maybe this breaks my attempts to
> master hg bookmarks...
>
>  With Mercurial 1.2.1 I do the following:
> 1) create a repository (let's call it "repo1"), add a file "file1.txt"
> there, commit it
> 2) clone the repository (let's call this one "repo2"), add bookmarks
> extension and "track.current = True" under "[bookmarks]" to hgrc, create
> bookmarks "master" and "quickfix" there
> 3) at repo2: "hg up -C quickfix", change the file "file1.txt", commit it
> 4) at repo2: switch to master: "hg up -C master", hg out - and see that the
> changes to "file1.txt" are propagated into push.
>
>  I expected that only changes to the branch I am on are propagated into
> push. Is it an expected behavior?
>
>  I am not very proficient with Mercurial and sorry for any stupidity I have
> written.
>
>  Thanks a lot for help!
>
> Regards,
>  Alexey
> --
> View this message in context: http://www.nabble.com/Please-help-with-Mercurial-Bookmarks-workflow-tp22986564p22986564.html
> Sent from the Mercurial mailing list archive at Nabble.com.
>
> _______________________________________________
> Mercurial mailing list
> Mercurial@...
> http://selenic.com/mailman/listinfo/mercurial
>

_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

Re: Please help with Mercurial Bookmarks workflow

by amaslov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the clarifications, hg out -r <bookmark_name> works indeed.

Martin Geisler-4 wrote:
amaslov <amaslov.p@gmail.com> writes:

> Hello,
>
>   I have been using local branches in git, maybe this breaks my attempts to
> master hg bookmarks...
>
>   With Mercurial 1.2.1 I do the following:
> 1) create a repository (let's call it "repo1"), add a file "file1.txt"
> there, commit it
> 2) clone the repository (let's call this one "repo2"), add bookmarks
> extension and "track.current = True" under "[bookmarks]" to hgrc, create
> bookmarks "master" and "quickfix" there
> 3) at repo2: "hg up -C quickfix", change the file "file1.txt", commit it
> 4) at repo2: switch to master: "hg up -C master", hg out - and see that the
> changes to "file1.txt" are propagated into push.
>
>   I expected that only changes to the branch I am on are propagated
> into push. Is it an expected behavior?

Yes, sort of -- push/pull simply move any missing changesets between
repositories. If you want to move only some revisions you can use the -r
flag to them (and to outgoing too).

I haven't tried, but I would guess that 'hg outgoing -r master' would
show only new changesets on your branch.

--
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.

 
_______________________________________________
Mercurial mailing list
Mercurial@selenic.com
http://selenic.com/mailman/listinfo/mercurial

Re: Please help with Mercurial Bookmarks workflow

by amaslov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks a lot, this is what I was actually looking for. Will give TaskExtension a try :)

willie-28 wrote:
Hi,

If you want to push changesets which you considered 'complete', I also
recommend you give the 'task' extension a try:

http://www.selenic.com/mercurial/wiki/index.cgi/TasksExtension

This extension not only provides the functions which similar to
bookmarks, but also has built-in stash which could automatically save
your current changes in working directory (yes, just like git stash).

Sincerely yours,

Willie

On Fri, Apr 10, 2009 at 7:24 PM, amaslov <amaslov.p@gmail.com> wrote:
>
> Hello,
>
>  I have been using local branches in git, maybe this breaks my attempts to
> master hg bookmarks...
>
>  With Mercurial 1.2.1 I do the following:
> 1) create a repository (let's call it "repo1"), add a file "file1.txt"
> there, commit it
> 2) clone the repository (let's call this one "repo2"), add bookmarks
> extension and "track.current = True" under "[bookmarks]" to hgrc, create
> bookmarks "master" and "quickfix" there
> 3) at repo2: "hg up -C quickfix", change the file "file1.txt", commit it
> 4) at repo2: switch to master: "hg up -C master", hg out - and see that the
> changes to "file1.txt" are propagated into push.
>
>  I expected that only changes to the branch I am on are propagated into
> push. Is it an expected behavior?
>
>  I am not very proficient with Mercurial and sorry for any stupidity I have
> written.
>
>  Thanks a lot for help!
>
> Regards,
>  Alexey
> --
> View this message in context: http://www.nabble.com/Please-help-with-Mercurial-Bookmarks-workflow-tp22986564p22986564.html
> Sent from the Mercurial mailing list archive at Nabble.com.
>
> _______________________________________________
> Mercurial mailing list
> Mercurial@selenic.com
> http://selenic.com/mailman/listinfo/mercurial
>

_______________________________________________
Mercurial mailing list
Mercurial@selenic.com
http://selenic.com/mailman/listinfo/mercurial

Re: Please help with Mercurial Bookmarks workflow

by newps :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This Tasks extension looks awesome.  In a previous thread I read that
Bill Barry has a centralized repository for his attic changes.  Would
it be possible to have a centralized repository for the tasks and task
stashes?  This would allow people to see the current tasks I'm working
on and provide me with a way to easily backup my tasks in the event
that my computer blows up or is stolen.  If so, this would make for
one heck of a workflow.

Or is this not going to be possible until you can push bookmarks over the wire?

Thanks,
Bradford

>> http://www.selenic.com/mercurial/wiki/index.cgi/TasksExtension
_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

Re: Please help with Mercurial Bookmarks workflow

by newps :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This looks promising too:  http://www.selenic.com/mercurial/wiki/index.cgi/PatchHandlingUnificationRFC?highlight=(attic)#head-fadee604f0fb80de7337faa9ae07fb97e4fcac94.

Regards,
Bradford

newps wrote:
This Tasks extension looks awesome.  In a previous thread I read that
Bill Barry has a centralized repository for his attic changes.  Would
it be possible to have a centralized repository for the tasks and task
stashes?  This would allow people to see the current tasks I'm working
on and provide me with a way to easily backup my tasks in the event
that my computer blows up or is stolen.  If so, this would make for
one heck of a workflow.

Or is this not going to be possible until you can push bookmarks over the wire?

Thanks,
Bradford

>> http://www.selenic.com/mercurial/wiki/index.cgi/TasksExtension
_______________________________________________
Mercurial mailing list
Mercurial@selenic.com
http://selenic.com/mailman/listinfo/mercurial

Re: Please help with Mercurial Bookmarks workflow

by Bugzilla from arne_bab@web.de :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am Freitag 10 April 2009 15:01:49 schrieb amaslov:
> Thanks for the clarifications, hg out -r <bookmark_name> works indeed.

The reason for the difference is simply that Mercurial assumes as default that
you want to get your repository data completely in sync, while git assumes
that you want to only synchronize some part and keep most of the changes to
yourself.

The same is true for commit:
- Mercurial commits all changes, as long as you don't specify files
  (or use the record extension).
- Git only commits explicitely added changes, as long as you don't use "-a".

It's a difference in philosophy.

Best wishes,
Arne
--
-- Ein Würfel System: http://1w6.org - einfach saubere (Rollenspiel-) Regeln.
-- Infinite Hands: http://infinite-hands.draketo.de - singing a part of the
history of free software.
-- My stuff: http://draketo.de - stories, songs, poems, programs and stuff :)

-- PGP/GnuPG: http://draketo.de/inhalt/ich/pubkey.txt

_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

Re: Please help with Mercurial Bookmarks workflow

by amaslov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Arne,

  Thanks for the explanation, though I still do not get the idea... What's the point in having local branches and syncing them with other repositories by default? I have created them to be local, haven't I? Mercurial has named branches which are shared...

Bugzilla from arne_bab@web.de wrote:
Am Freitag 10 April 2009 15:01:49 schrieb amaslov:
> Thanks for the clarifications, hg out -r <bookmark_name> works indeed.

The reason for the difference is simply that Mercurial assumes as default that
you want to get your repository data completely in sync, while git assumes
that you want to only synchronize some part and keep most of the changes to
yourself.

The same is true for commit:
- Mercurial commits all changes, as long as you don't specify files
  (or use the record extension).
- Git only commits explicitely added changes, as long as you don't use "-a".

It's a difference in philosophy.

Best wishes,
Arne
--
-- Ein Würfel System: http://1w6.org - einfach saubere (Rollenspiel-) Regeln.
-- Infinite Hands: http://infinite-hands.draketo.de - singing a part of the
history of free software.
-- My stuff: http://draketo.de - stories, songs, poems, programs and stuff :)

-- PGP/GnuPG: http://draketo.de/inhalt/ich/pubkey.txt

_______________________________________________
Mercurial mailing list
Mercurial@selenic.com
http://selenic.com/mailman/listinfo/mercurial

Re: Please help with Mercurial Bookmarks workflow

by Martin Geisler-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

amaslov <amaslov.p@...> writes:

> Arne,
>
>   Thanks for the explanation, though I still do not get the idea...
> What's the point in having local branches and syncing them with
> other repositories by default? I have created them to be local,
> haven't I? Mercurial has named branches which are shared...

You can make *clones* which are truely local.

They also give you better separatation between different ongoing
changes since you have a working directory for each clone whereas all
your branches by necessity share the same working directory.

--
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

Re: Please help with Mercurial Bookmarks workflow

by Bugzilla from arne_bab@web.de :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am Mittwoch 15 April 2009 11:05:15 schrieb amaslov:
>   Thanks for the explanation, though I still do not get the idea... What's
> the point in having local branches and syncing them with other repositories
> by default? I have created them to be local, haven't I? Mercurial has named
> branches which are shared...

The branch-names of local branches are local. These names don't propagate when
you push. They are simply local pointers to certain revisions.

The actual changesets they point to are part of the normal history, though, so
they get propagated, but without the branch names.

The reason is, that you can use local branches/bookmarks as a reminder for
yourself, where you currently are, without cluttering history with stuff which
is only useful (and/or understandable) to you.


If you want the equivalent of local patches in your main repository, please
have a look at the attic extension or at the more powerful but also a bit more
dangerous Mercurial Queue extension (dangerous means that you can rewrite
history with it).

If you want to collapse the local changes before propagating them, or if you
want to work together with others on a patch, you can also use a second clone
with the pbranch extension.

Otherwise you can just work in feature clones and push into your main repo
once you finished working.

- http://www.selenic.com/mercurial/wiki/index.cgi/AtticExtension
- http://www.selenic.com/mercurial/wiki/index.cgi/MqExtension
- http://www.selenic.com/mercurial/wiki/index.cgi/PatchBranchExtension

For other useful extensions, please have a look at UsingExtensions:

- http://www.selenic.com/mercurial/wiki/index.cgi/UsingExtensions

Best wishes,
Arne
--
-- Ein Würfel System: http://1w6.org - einfach saubere (Rollenspiel-) Regeln.
-- Infinite Hands: http://infinite-hands.draketo.de - singing a part of the
history of free software.
-- My stuff: http://draketo.de - stories, songs, poems, programs and stuff :)

-- PGP/GnuPG: http://draketo.de/inhalt/ich/pubkey.txt

_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

Re: Please help with Mercurial Bookmarks workflow

by amaslov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Martin,

  Clones are indeed a possible solution. It is not practical though for our project since we have a small number of files not under version control (personal config files, for instance). Thus clone is much more heavyweight operation than creating a local branch.

  Tasks extensions works just fine for me, so the rest of the discussion is more about understanding...

Martin Geisler-4 wrote:
amaslov <amaslov.p@gmail.com> writes:

> Arne,
>
>   Thanks for the explanation, though I still do not get the idea...
> What's the point in having local branches and syncing them with
> other repositories by default? I have created them to be local,
> haven't I? Mercurial has named branches which are shared...

You can make *clones* which are truely local.

They also give you better separatation between different ongoing
changes since you have a working directory for each clone whereas all
your branches by necessity share the same working directory.

--
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
_______________________________________________
Mercurial mailing list
Mercurial@selenic.com
http://selenic.com/mailman/listinfo/mercurial

Re: Please help with Mercurial Bookmarks workflow

by amaslov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Arne,

  Very clear answer indeed, thanks a lot! I have probably been trying to use bookmarks for things they were not intended for. Also thanks for the links to useful extensions, will take a look :).

Bugzilla from arne_bab@web.de wrote:
Am Mittwoch 15 April 2009 11:05:15 schrieb amaslov:
>   Thanks for the explanation, though I still do not get the idea... What's
> the point in having local branches and syncing them with other repositories
> by default? I have created them to be local, haven't I? Mercurial has named
> branches which are shared...

The branch-names of local branches are local. These names don't propagate when
you push. They are simply local pointers to certain revisions.

The actual changesets they point to are part of the normal history, though, so
they get propagated, but without the branch names.

The reason is, that you can use local branches/bookmarks as a reminder for
yourself, where you currently are, without cluttering history with stuff which
is only useful (and/or understandable) to you.


If you want the equivalent of local patches in your main repository, please
have a look at the attic extension or at the more powerful but also a bit more
dangerous Mercurial Queue extension (dangerous means that you can rewrite
history with it).

If you want to collapse the local changes before propagating them, or if you
want to work together with others on a patch, you can also use a second clone
with the pbranch extension.

Otherwise you can just work in feature clones and push into your main repo
once you finished working.

- http://www.selenic.com/mercurial/wiki/index.cgi/AtticExtension
- http://www.selenic.com/mercurial/wiki/index.cgi/MqExtension
- http://www.selenic.com/mercurial/wiki/index.cgi/PatchBranchExtension

For other useful extensions, please have a look at UsingExtensions:

- http://www.selenic.com/mercurial/wiki/index.cgi/UsingExtensions

Best wishes,
Arne
--
-- Ein Würfel System: http://1w6.org - einfach saubere (Rollenspiel-) Regeln.
-- Infinite Hands: http://infinite-hands.draketo.de - singing a part of the
history of free software.
-- My stuff: http://draketo.de - stories, songs, poems, programs and stuff :)

-- PGP/GnuPG: http://draketo.de/inhalt/ich/pubkey.txt

_______________________________________________
Mercurial mailing list
Mercurial@selenic.com
http://selenic.com/mailman/listinfo/mercurial