changeset 3768:482195001997

branching: merge with compat fix on default
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 24 May 2018 18:57:46 +0200
parents cd194eb336bd (current diff) 115caa4e5278 (diff)
children 1bc4b0807c37
files hgext3rd/topic/__init__.py
diffstat 5 files changed, 136 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/README	Wed May 23 01:24:02 2018 +0200
+++ b/README	Thu May 24 18:57:46 2018 +0200
@@ -83,17 +83,25 @@
 How to Contribute
 =================
 
+Discussion happens on the #hg-evolve IRC on freenode_.
+
+.. _freenode: https://freenode.net/
+
 Bugs are to be reported on the mercurial's bug tracker (component: `evolution`_):
 
 .. _evolution: https://bz.mercurial-scm.org/buglist.cgi?component=evolution&query_format=advanced&resolution=---
 
-Please use the patchbomb extension to send email to `mercurial devel
+You can use the patchbomb extension to send email to `mercurial devel
 <https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel>`_. Please make
 sure to use the evolve-ext flag when doing so. You can use a command like
 this::
 
     $ hg email --to mercurial-devel@mercurial-scm.org --flag evolve-ext --rev '<your patches>'
 
+Some of development happens on a public bitbucket repository (`evolve-devel`_) using the topic extension.
+
+.. _`evolve-devel`: https://bitbucket.org/octobus/evolve-devel
+
 For guidelines on the patch description, see the `official Mercurial guideline`_.
 
 .. _`official Mercurial guideline`: https://mercurial-scm.org/wiki/ContributingChanges#Patch_descriptions
--- a/hgext3rd/evolve/compat.py	Wed May 23 01:24:02 2018 +0200
+++ b/hgext3rd/evolve/compat.py	Thu May 24 18:57:46 2018 +0200
@@ -13,7 +13,9 @@
     mdiff,
     obsolete,
     obsutil,
+    repair,
     revset,
+    scmutil,
     util,
     vfs as vfsmod,
 )
@@ -195,6 +197,14 @@
 except (ImportError, AttributeError):
     updateresult = None
 
+# 46c2b19a1263f18a5829a21b7a5053019b0c5a31 in hg moved repair.stripbmrevset to
+# scmutil.bookmarkrevs
+# This change is a part of 4.7 cycle, so drop this when we drop support for 4.6
+try:
+    bmrevset = repair.stripbmrevset
+except AttributeError:
+    bmrevset = scmutil.bookmarkrevs
+
 def hasconflict(upres):
     if updateresult is None:
         return bool(upres[-1])
--- a/hgext3rd/evolve/rewriteutil.py	Wed May 23 01:24:02 2018 +0200
+++ b/hgext3rd/evolve/rewriteutil.py	Thu May 24 18:57:46 2018 +0200
@@ -22,7 +22,6 @@
     node,
     obsolete,
     phases,
-    repair,
     revset,
     util,
 )
@@ -155,7 +154,7 @@
         nodetobookmarks.setdefault(bnode, []).append(mark)
     for marks in nodetobookmarks.values():
         if bookmarks.issuperset(marks):
-            rsrevs = repair.stripbmrevset(repo, marks[0])
+            rsrevs = compat.bmrevset(repo, marks[0])
             revs = set(revs)
             revs.update(set(rsrevs))
             revs = sorted(revs)
--- a/hgext3rd/topic/__init__.py	Wed May 23 01:24:02 2018 +0200
+++ b/hgext3rd/topic/__init__.py	Thu May 24 18:57:46 2018 +0200
@@ -70,6 +70,8 @@
 The extensions come with an option to enforce that there is only one heads for
 each name in the repository at any time.
 
+::
+
     [experimental]
     enforce-single-head = yes
 
@@ -80,15 +82,18 @@
 phase usually happens on push, but it is possible to update that behavior. The
 server needs to have specific config for this.
 
-    # everything pushed become public (the default)
+* everything pushed become public (the default)::
+
     [phase]
     publish = yes
 
-    # nothing push turned public
+* nothing push turned public::
+
     [phase]
     publish = no
 
-    # topic branches are not published, changeset without topic are
+* topic branches are not published, changeset without topic are::
+
     [phase]
     publish = no
     [experimental]
--- a/tests/test-topic.t	Wed May 23 01:24:02 2018 +0200
+++ b/tests/test-topic.t	Thu May 24 18:57:46 2018 +0200
@@ -12,6 +12,114 @@
   > graphstyle.missing = |
   > EOF
 
+  $ hg help -e topic
+  topic extension - support for topic branches
+  
+  Topic branches are lightweight branches which disappear when changes are
+  finalized (move to the public phase).
+  
+  Compared to bookmark, topic is reference carried by each changesets of the
+  series instead of just the single head revision.  Topic are quite similar to
+  the way named branch work, except they eventually fade away when the changeset
+  becomes part of the immutable history. Changeset can belong to both a topic
+  and a named branch, but as long as it is mutable, its topic identity will
+  prevail. As a result, default destination for 'update', 'merge', etc...  will
+  take topic into account. When a topic is active these operations will only
+  consider other changesets on that topic (and, in some occurrence, bare
+  changeset on same branch).  When no topic is active, changeset with topic will
+  be ignored and only bare one on the same branch will be taken in account.
+  
+  There is currently two commands to be used with that extension: 'topics' and
+  'stack'.
+  
+  The 'hg topics' command is used to set the current topic, change and list
+  existing one. 'hg topics --verbose' will list various information related to
+  each topic.
+  
+  The 'stack' will show you information about the stack of commit belonging to
+  your current topic.
+  
+  Topic is offering you aliases reference to changeset in your current topic
+  stack as 't#'. For example, 't1' refers to the root of your stack, 't2' to the
+  second commits, etc. The 'hg stack' command show these number.
+  
+  Push behavior will change a bit with topic. When pushing to a publishing
+  repository the changesets will turn public and the topic data on them will
+  fade away. The logic regarding pushing new heads will behave has before,
+  ignore any topic related data. When pushing to a non-publishing repository
+  (supporting topic), the head checking will be done taking topic data into
+  account. Push will complain about multiple heads on a branch if you push
+  multiple heads with no topic information on them (or multiple public heads).
+  But pushing a new topic will not requires any specific flag. However, pushing
+  multiple heads on a topic will be met with the usual warning.
+  
+  The 'evolve' extension takes 'topic' into account. 'hg evolve --all' will
+  evolve all changesets in the active topic. In addition, by default. 'hg next'
+  and 'hg prev' will stick to the current topic.
+  
+  Be aware that this extension is still an experiment, commands and other
+  features are likely to be change/adjusted/dropped over time as we refine the
+  concept.
+  
+  topic-mode
+  ==========
+  
+  The topic extension can be configured to ensure the user do not forget to add
+  a topic when committing a new topic:
+  
+    [experimental]
+    # behavior when commit is made without an active topic
+    topic-mode = ignore # do nothing special (default)
+    topic-mode = warning # print a warning
+    topic-mode = enforce # abort the commit (except for merge)
+    topic-mode = enforce-all # abort the commit (even for merge)
+    topic-mode = random # use a randomized generated topic (except for merge)
+    topic-mode = random-all # use a randomized generated topic (even for merge)
+  
+  Single head enforcing
+  =====================
+  
+  The extensions come with an option to enforce that there is only one heads for
+  each name in the repository at any time.
+  
+    [experimental]
+    enforce-single-head = yes
+  
+  Publishing behavior
+  ===================
+  
+  Topic vanish when changeset move to the public phases. Moving to the public
+  phase usually happens on push, but it is possible to update that behavior. The
+  server needs to have specific config for this.
+  
+  * everything pushed become public (the default):
+  
+      [phase]
+      publish = yes
+  
+  * nothing push turned public:
+  
+      [phase]
+      publish = no
+  
+  * topic branches are not published, changeset without topic are:
+  
+      [phase]
+      publish = no
+      [experimental]
+      topic.publish-bare-branch = yes
+  
+  In addition, the topic extension adds a "--publish" flag on 'hg push'. When
+  used, the pushed revisions are published if the push succeeds. It also applies
+  to common revisions selected by the push.
+  
+  list of commands:
+  
+   stack         list all changesets in a topic and other information
+   topics        View current topic, set current topic, change topic for a set
+                 of revisions, or see all topics.
+  
+  (use 'hg help -v topic' to show built-in aliases and global options)
   $ hg help topics
   hg topics [TOPIC]