> On 7 May 2021, at 17.31, Uwe Brauer <
o...@mat.ucm.es> wrote:
> Short answer: no, sorry.
> Long answer:
> From a technical perspective, topics are the same as branches but in a
> different namespace. Like branches, the “topic” of a changeset is part
> of it and embedded in its extra metadata. The changeset is identified
> by its hash, which is calculated based on its contents, including that
> extra metadata. So just as with its branch, you cannot alter the topic
> of a changeset without creating a new and different changeset. The
> reason you don't notice this is that the topic extension builds on
> topic of history evolution, and transparently manages that — and
> disregards the topic of any published changeset.
Well I also wanted to ask about named branches (which I use more, but I
though topics are more suitable for short lived branches and also more
hm sexy)
> So, if you were to implement this, a reasonable starting point would
> be to add support for pulling Git branches as Mercurial branches. Most
> of the logic should apply to topics as well.
> Now, what's the challenge with branches/topics? With both, converting
> from a Git commit into a Mercurial equivalent, would require knowing
> _into_ which branch or topic that should be. Similarly, any given Git
> commit could belong to any number of branches or topics.
> The reason for converting Git branches into bookmarks is that they map
> rather well to each other — by design. Converting them into proper
> branches or even topics would indeed be much nicer, but it's also
> significantly harder. Personally, I'd rather improve the bookmarks
> workflow first.
Hm, I thought creating a branch in git always create a head (in
mercurial terminology), while creating a bookmark in HG not necessarily
does it.
Be it as it may, from a purely user point of view,
a repository with bookmarks (cloned from git) looks like this
changeset: 6:94feac535ac7
│ Branch: default
│ tag: tip
│ bookmark: master
│ Author: Uwe Brauer <
o...@mat.ucm.es>
│ Date: Sat, 08 May 2021 10:40:56 +0200
│ Phase: draft
│ Summary: Fifth
│
│ ○ changeset: 5:ee142658daaa
│ │ Branch: default
│ │ bookmark: feature
│ │ Author: Uwe Brauer <
o...@mat.ucm.es>
│ │ Date: Sat, 08 May 2021 10:40:56 +0200
│ │ Phase: draft
│ │ Summary: Second in branch
│ │
│ ○ changeset: 4:3e173b96e671
│ │ Branch: default
│ │ Author: Uwe Brauer <
o...@mat.ucm.es>
│ │ Date: Sat, 08 May 2021 10:40:55 +0200
│ │ Phase: draft
│ │ Summary: First in branch
│ │
○ │ changeset: 3:913fe1a11c00
A repository created with HG and named branches would be of this form.
changeset: 6:78fcac51de7b
│ Branch: default
│ tag: tip
│ Author: Uwe Brauer <
o...@mat.ucm.es>
│ Date: Sat, 08 May 2021 10:37:30 +0200
│ Phase: draft
│ Summary: Fifth
│
│ ○ changeset: 5:67ba3f39fcb2
│ │ Branch: feature
│ │ Author: Uwe Brauer <
o...@mat.ucm.es>
│ │ Date: Sat, 08 May 2021 10:37:29 +0200
│ │ Phase: draft
│ │ Summary: Second in branch
│ │
│ ○ changeset: 4:5d3ba31ee3b2
│ │ Branch: feature
│ │ Author: Uwe Brauer <
o...@mat.ucm.es>
│ │ Date: Sat, 08 May 2021 10:37:29 +0200
│ │ Phase: draft
│ │ Summary: First in branch
│ │
○ │ changeset: 3:562767f9dce7
So it contains the nice tag «feature» indicating the branch from the
beginning to the end, which is so helpful.
Now it is possible to «transform» the «branch/topological» head with the
bookmark «feature» into a real named branch using evolve:
hg book -d feature
hg up 4
hg branch feature
hg amend
hg evolve
Which results in
○ changeset: 8:90c029ba68b6
│ Branch: feature
│ tag: tip
│ Author: Uwe Brauer <
o...@mat.ucm.es>
│ Date: Sat, 08 May 2021 10:42:43 +0200
│ Phase: draft
│ Summary: Second in branch
│
◍ changeset: 7:d33c3cb4320b
│ Branch: feature
│ Author: Uwe Brauer <
o...@mat.ucm.es>
│ Date: Sat, 08 May 2021 10:42:43 +0200
│ Phase: draft
│ Summary: First in branch
│
│ ○ changeset: 6:0a988c629ea1
│ │ Branch: default
│ │ bookmark: master
│ │ Author: Uwe Brauer <
o...@mat.ucm.es>
│ │ Date: Sat, 08 May 2021 10:42:43 +0200
│ │ Phase: draft
│ │ Summary: Fifth
│ │
│ ○ changeset: 3:a6d02fd3ddf9
│╱ Branch: default
│ Author: Uwe Brauer <
o...@mat.ucm.es>
│ Date: Sat, 08 May 2021 10:42:42 +0200
│ Phase: draft
│ Summary: Fourth
Ok the hashes have changed and the old changesets are now marked as
obsolete. If would do this will a git repository I cloned, and
«transformed» the bookmark like this, it would screw things up when
trying to push.
So the question is:
could such an operation be done, so that the new
changesets, will obtain the original corresponding git hashes????
That would be a first step forward, so one could manually transform
bookmarks into named branch.
I presume it is not possible since otherwise it would have already be
implemented.
Regards
Uwe