82.67.117.220: Answering Jaroslav's interrogation about rebase - 2009-07-12 09:19:54

Answering Jaroslav's interrogation about rebase

←Older revision Revision as of 09:19, 12 July 2009
Line 26: Line 26:
--[[User:JaroslavTulach|JaroslavTulach]] 04:37, 10 April 2009 (UTC)
--[[User:JaroslavTulach|JaroslavTulach]] 04:37, 10 April 2009 (UTC)
 +
 +
:[http://mercurial.selenic.com/wiki/RebaseExtension rebase] is a Mercurial command. It is shipped as an official extension and needs to be explicitely activated in your hgrc, as it rewrites history.
 +
<source lang="ini">
 +
[extensions]
 +
rebase =
 +
</source>
 +
: --cedric

JaroslavTulach at 04:39, 10 April 2009 - 2009-04-10 04:39:03

←Older revision Revision as of 04:39, 10 April 2009
Line 23: Line 23:
</source>
</source>
-
But how exactly do ''rebase'' for multiple commits is not really clear to me. Maybe with ''hg strip''?
+
But how exactly do ''rebase'' for multiple commits is not really clear to me. Maybe with ''hg strip''? But this is getting complex, no [[cluelessness]] at all.
--[[User:JaroslavTulach|JaroslavTulach]] 04:37, 10 April 2009 (UTC)
--[[User:JaroslavTulach|JaroslavTulach]] 04:37, 10 April 2009 (UTC)

JaroslavTulach at 04:38, 10 April 2009 - 2009-04-10 04:38:14

←Older revision Revision as of 04:38, 10 April 2009
Line 5: Line 5:
--parren
--parren
-
Interesting note. Thanks. I copied it to [[Mercurial vs. Subversion|main page]]. Feel free to edit it there. One question through. What you mean by ''rebase''. I only found [[Git]]'s rebase, but nothing for [[Mercurial]]. I know I can do:
+
Interesting note. Thanks. I copied it to [[Mercurial vs. Subversion|main page]]. Feel free to edit it there. One question through. What you mean by ''rebase''? I only found [[Git]]'s rebase, but nothing for [[Mercurial]]. I know I can do:
<source lang="bash">
<source lang="bash">

JaroslavTulach at 04:37, 10 April 2009 - 2009-04-10 04:37:41

←Older revision Revision as of 04:37, 10 April 2009
Line 2: Line 2:
Not exactly. Mercurial would record the two changes as separate heads (implicit branches). And, by default, it would not allow pushing both to a central repo without a prior merge. But this is just a default. What typically bothers people is they need to merge the two heads to combine their effects. Which is, again, correct, but may seem to clutter history. So you can rebase, if you prefer, explicitly emulating what svn implicitly does.
Not exactly. Mercurial would record the two changes as separate heads (implicit branches). And, by default, it would not allow pushing both to a central repo without a prior merge. But this is just a default. What typically bothers people is they need to merge the two heads to combine their effects. Which is, again, correct, but may seem to clutter history. So you can rebase, if you prefer, explicitly emulating what svn implicitly does.
-
-parren
+
 
 +
--parren
Interesting note. Thanks. I copied it to [[Mercurial vs. Subversion|main page]]. Feel free to edit it there. One question through. What you mean by ''rebase''. I only found [[Git]]'s rebase, but nothing for [[Mercurial]]. I know I can do:
Interesting note. Thanks. I copied it to [[Mercurial vs. Subversion|main page]]. Feel free to edit it there. One question through. What you mean by ''rebase''. I only found [[Git]]'s rebase, but nothing for [[Mercurial]]. I know I can do:
-
<script lang="bash">
+
<source lang="bash">
# with some local changes
# with some local changes
hg pull -u
hg pull -u
hg ci -m "..."
hg ci -m "..."
hg push
hg push
-
</script>
+
</source>
and effectively do ''rebase'' before single commit. Or, in case I've already integrated my commit I can:
and effectively do ''rebase'' before single commit. Or, in case I've already integrated my commit I can:
-
<script lang="bash">
+
<source lang="bash">
hg push # fails and I do not want 2nd head
hg push # fails and I do not want 2nd head
hg rollback
hg rollback
Line 20: Line 21:
hg ci -m "..."
hg ci -m "..."
hg push
hg push
-
</script>
+
</source>
But how exactly do ''rebase'' for multiple commits is not really clear to me. Maybe with ''hg strip''?
But how exactly do ''rebase'' for multiple commits is not really clear to me. Maybe with ''hg strip''?
 +
 +
--[[User:JaroslavTulach|JaroslavTulach]] 04:37, 10 April 2009 (UTC)

JaroslavTulach at 04:36, 10 April 2009 - 2009-04-10 04:36:22

←Older revision Revision as of 04:36, 10 April 2009
Line 3: Line 3:
Not exactly. Mercurial would record the two changes as separate heads (implicit branches). And, by default, it would not allow pushing both to a central repo without a prior merge. But this is just a default. What typically bothers people is they need to merge the two heads to combine their effects. Which is, again, correct, but may seem to clutter history. So you can rebase, if you prefer, explicitly emulating what svn implicitly does.
Not exactly. Mercurial would record the two changes as separate heads (implicit branches). And, by default, it would not allow pushing both to a central repo without a prior merge. But this is just a default. What typically bothers people is they need to merge the two heads to combine their effects. Which is, again, correct, but may seem to clutter history. So you can rebase, if you prefer, explicitly emulating what svn implicitly does.
-parren
-parren
 +
 +
Interesting note. Thanks. I copied it to [[Mercurial vs. Subversion|main page]]. Feel free to edit it there. One question through. What you mean by ''rebase''. I only found [[Git]]'s rebase, but nothing for [[Mercurial]]. I know I can do:
 +
 +
<script lang="bash">
 +
# with some local changes
 +
hg pull -u
 +
hg ci -m "..."
 +
hg push
 +
</script>
 +
 +
and effectively do ''rebase'' before single commit. Or, in case I've already integrated my commit I can:
 +
<script lang="bash">
 +
hg push # fails and I do not want 2nd head
 +
hg rollback
 +
hg pull -u
 +
hg ci -m "..."
 +
hg push
 +
</script>
 +
 +
But how exactly do ''rebase'' for multiple commits is not really clear to me. Maybe with ''hg strip''?

80.219.179.97: Details about Mercurial's behaviour - 2009-04-09 11:30:52

Details about Mercurial's behaviour

New page

<quote>Mercurial would refuse such integration asking the user A to svn update to latest version of the repository first. This is the correct behaviour. However it is not really clueless.</quote>

Not exactly. Mercurial would record the two changes as separate heads (implicit branches). And, by default, it would not allow pushing both to a central repo without a prior merge. But this is just a default. What typically bothers people is they need to merge the two heads to combine their effects. Which is, again, correct, but may seem to clutter history. So you can rebase, if you prefer, explicitly emulating what svn implicitly does.
-parren