Differences between revisions 1 and 23 (spanning 22 versions)
Revision 1 as of 2015-05-21 03:26:01
Size: 619
Comment:
Revision 23 as of 2015-06-12 10:45:40
Size: 3910
Comment: move some content to Feature Branches Struggles
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#pragma section-numbers 2
Line 3: Line 5:
A plan for light weight branching/categorization what would work with other Mercurial principle and actual DVCS idea. = Topic Plan =
Line 5: Line 7:
Still a very early prototype stage. A (speculative) plan for topic branching that would work more seamlessly with common Mercurial workflows. Still very early prototype stage. Everything is subject to change.
Line 9: Line 11:
== Principle == == Problem Statement ==
Line 11: Line 13:
assign topics to non-public changesets The Mercurial community has been struggling for years to define a nice way to handle 'topic' branches (sometimes also called 'feature' branches), especially when it comes to sharing them with other people (mainly for code review or other collaboration.)
Line 13: Line 15:
== Problem solved == Bookmarks are a clone of git's refs, which seems to work more poorly in Mercurial than they do in Git, in part because the synchronization parts of bookmarks aren't really done. Adding the remaining bits of git's refs to Mercurial has been controversial, and may represent enough of a behavior change that it's infeasible.
Line 15: Line 17:
=== What Topic solve === Named branches are visible forever in the revision history, which makes them unsuitable for feature branch work as the feature branch names rapidly pollute the output of things like `hg branches`.
Line 17: Line 19:
(Use case Topic target to address) == Open ideas ==
Line 19: Line 21:
=== What Topic may solve === This is a list of idea that emerged while brainstorming.
Line 21: Line 23:
(Use case that exists but it is not clear if Topic should try to solve them)  * Topic could be a property attached to each changeset (grouping them by similar topic)
Line 23: Line 25:
=== What Topic do not solve ===  * Topic could fade away when changesets become public (either archived or plain dropped)
   * A benefit of archiving them is that users can query for topics, eg you could say `hg log -r topic(issue123)` which would help
Line 25: Line 28:
(Use case we know belong to other feature)  * Tracking could be achieved through the naming scheme. eg:
   * 'default//feature-foo' would be a topic 'feature-foo' tracking the 'default' branch.
   * 'stable//issue4700' would be a topic 'issue4700' tracking branch stable.
   * '@//feature-bar' would be a topic 'feature-bar' tracking bookmark '@' ?
   * 'stable//issue4689//issue4700' would be a topic 'issue4700' tracking the topic 'stable//issue4689'. When topic 'issue4686' face away (because published), the tracking fallback to 'stable'.
Line 27: Line 34:
== Principe ==  * Topics could be non contiguous ([[mpm]] idea) feature-foo -> fix-bar -> feature-foo. Allowing a streamlined work that is automatically split apart after that.
Line 29: Line 36:
 * Topics could be hierarchical 'issue4700.test' 'issue4700.preparation', activation//reference could be done at any level 'issue4700' or 'issue4700' (this could help handle branching/different approach)

 * pushing a new head on a new topic to a '''non-publishing server''' would be allowed.
   * that is, it'd be legal to have one head per topic on a non-publishing server.

 * A changeset could maybe have multiple topic.
   * Augie doesn't feel great about this option just because of UI complexity.

 * Users can name patches (in a sense) without mq
   * One of the major complaints about evolve from veteran mq users is that their patches no longer have explicit names. Topics provide a potential way to name patches again.

== Current Implementation ==

Assign topics to non-public changesets. A topic is like a named branch, in that it is a label stored in a changeset's extra, but that topics just disappear when the change moves to public phase (the data still exists, it's just not shown.)

Code is available at [[http://hg.durin42.com/hg-topic-experiment/]].

==== Non-Goals ====

 * Topics are not suitable for long term branches. We have named branches for that (and possibly also bookmarks, depending on workflow.)

 * Topics are not suitable for tracking a moving point in public history. This seems to be a perfect fit for bookmarks.


=== Open Questions ===

 * Right now we use changeset extra for storing the topic. That might lead to bonus divergence problems. They might be easily fixed, but should we avoid that?
 * Should changesets be allowed multiple topics?
 * How permissive should we be on topic names?

== See also ==

 * FeatureBranchesStruggle

Note:

This page is primarily intended for developers of Mercurial.

Topic Plan

A (speculative) plan for topic branching that would work more seamlessly with common Mercurial workflows. Still very early prototype stage. Everything is subject to change.

1. Problem Statement

The Mercurial community has been struggling for years to define a nice way to handle 'topic' branches (sometimes also called 'feature' branches), especially when it comes to sharing them with other people (mainly for code review or other collaboration.)

Bookmarks are a clone of git's refs, which seems to work more poorly in Mercurial than they do in Git, in part because the synchronization parts of bookmarks aren't really done. Adding the remaining bits of git's refs to Mercurial has been controversial, and may represent enough of a behavior change that it's infeasible.

Named branches are visible forever in the revision history, which makes them unsuitable for feature branch work as the feature branch names rapidly pollute the output of things like hg branches.

2. Open ideas

This is a list of idea that emerged while brainstorming.

  • Topic could be a property attached to each changeset (grouping them by similar topic)
  • Topic could fade away when changesets become public (either archived or plain dropped)
    • A benefit of archiving them is that users can query for topics, eg you could say hg log -r topic(issue123) which would help

  • Tracking could be achieved through the naming scheme. eg:
    • 'default//feature-foo' would be a topic 'feature-foo' tracking the 'default' branch.
    • 'stable//issue4700' would be a topic 'issue4700' tracking branch stable.
    • '@//feature-bar' would be a topic 'feature-bar' tracking bookmark '@' ?
    • 'stable//issue4689//issue4700' would be a topic 'issue4700' tracking the topic 'stable//issue4689'. When topic 'issue4686' face away (because published), the tracking fallback to 'stable'.
  • Topics could be non contiguous (mpm idea) feature-foo -> fix-bar -> feature-foo. Allowing a streamlined work that is automatically split apart after that.

  • Topics could be hierarchical 'issue4700.test' 'issue4700.preparation', activation//reference could be done at any level 'issue4700' or 'issue4700' (this could help handle branching/different approach)
  • pushing a new head on a new topic to a non-publishing server would be allowed.

    • that is, it'd be legal to have one head per topic on a non-publishing server.
  • A changeset could maybe have multiple topic.
    • Augie doesn't feel great about this option just because of UI complexity.
  • Users can name patches (in a sense) without mq
    • One of the major complaints about evolve from veteran mq users is that their patches no longer have explicit names. Topics provide a potential way to name patches again.

3. Current Implementation

Assign topics to non-public changesets. A topic is like a named branch, in that it is a label stored in a changeset's extra, but that topics just disappear when the change moves to public phase (the data still exists, it's just not shown.)

Code is available at http://hg.durin42.com/hg-topic-experiment/.

3.0.1. Non-Goals

  • Topics are not suitable for long term branches. We have named branches for that (and possibly also bookmarks, depending on workflow.)
  • Topics are not suitable for tracking a moving point in public history. This seems to be a perfect fit for bookmarks.

3.1. Open Questions

  • Right now we use changeset extra for storing the topic. That might lead to bonus divergence problems. They might be easily fixed, but should we avoid that?
  • Should changesets be allowed multiple topics?
  • How permissive should we be on topic names?

4. See also


CategoryDeveloper and CategoryNewFeatures

TopicPlan (last edited 2021-10-08 14:11:59 by GeorgesRacinet)