Commits

Pierre-Yves David  committed ca54598 Merge

merge with stable

  • Participants
  • Parent commits 3d5bed0, 8e41d5b
  • Branches default

Comments (0)

Files changed (12)

 c062edbcaf13135d0312fd2039deca74573ff4f0 1.1.0
 22cacfce2a65ab965c6179ae862b148f4abc7d8a 1.1.0
 d43e80504e55db9ad4826e860e50530103a27b0f 2.0.0
+f9d305deeff3dba782e65faf4ef3fd1569995859 2.1.0
 Changelog
 ==================
 
-2.4.0 -- 2012-10-26
+2.2.0 --
+
+- make evolve smarter at picking next troubled to solved without --any
+
+2.1.0 -- 2012-12-03
+
+- qsync fixes
+- have qfold ask for commit message
+
+2.0.0 -- 2012-10-26
 
 - compat with mercurial 2.4
 

File debian/changelog

+mercurial-evolve (2.1.0-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Pierre-Yves David <pierre-yves.david@logilab.fr>  Mon, 03 Dec 2012 15:19:19 +0100
+
 mercurial-evolve (1.1.0-1) UNRELEASED; urgency=low
 
   * New upstream release.

File docs/evolve-faq.rst

   # current changeset (.) and previous one (.^) replace A (42)
   $ hg prune --new . --new .^ 42
 
+For more complexe scenario we recommand the use of the histedit_ extension.
 
-Update my current work in progess after a pull
+.. _histedit:: http://mercurial.selenic.com/wiki/HisteditExtension
+
+
+Update my current work in progress after a pull
 ----------------------------------------------
 
-Whenever you are working on some changesets, it is more likely that a pull 
+Whenever you are working on some changesets, it is more likely that a pull
 will, eventually, import new changesets in your tree.
 
-And it is likely that you will want your work in progress changsets to be 
+And it is likely that you will want your work in progress changiesets to be
 rebased on the top of this newly imported subtree.
 
 Doing so is only a matter of rebasing.

File docs/from-mq.rst

 qseries                         ``log``
 qnew                            ``commit``
 qrefresh                        ``amend``
+qrefresh --exclude              ``uncommit``
 qpop                            ``update`` or ``gdown``
 qpush                           ``update`` or ``gup`` sometimes ``evolve``
 qrm                             ``prune``
 qfold                           ``fold``
 qdiff                           ``odiff``
-qrecord                         ``/qrecord``
+qrecord                         ``record``
 
 qfinish                         --
 qimport                         --
 ..   $ hg record babar.py
 ..   $ hg amend -c .^ # .^ refer to "working directoy parent, here 'feature A'
 
-note: refresh is an alias for amend
+.. note: refresh is an alias for amend
 
-hg qref -X
-````````````
+hg qref --exclude
+`````````````````````
 
 To remove changes from you current commit use::
 
 ````````
 
 When you rewrite changesets, descendants of rewritten changesets are marked as
-"out of sync". You need to rewrite them on top of the new version of their
+"unstable". You need to rewrite them on top of the new version of their
 ancestor.
 
-The evolution extension adds a command to rewrite the "out of sync"
+The evolution extension adds a command to rewrite "unstable"
 changesets:::
 
   $ hg evolve
 
   $ hg prune <revset>
 
-hg qrm
-```````
-
-::
-
-  $ hg fold <first>::<last>
-
 hg qfold
 `````````
 

File docs/index.rst

 The effort is split in two parts:
 
  * The **obsolescence marker** concept aims to provide an alternative to ``strip``
-   to get rid of changesets. This concept have been partially implemented in
+   to get rid of changesets. This concept have been partially implemented since
    Mercurial 2.3.
 
  * The **evolve** mercurial extension rewrites history using obsolete
 
              Production ready version should hide such details to normal user.
 
-The evolve extension require mercurial 2.3
+The evolve extension requires mercurial 2.4 (older version supports 2.3 and 2.2)
 
 To enable the evolve extension use::
 
     $ hg clone https://bitbucket.org/marmoute/mutable-history -u stable
     $ echo '[extensions]\nevolve=$PWD/mutable-history/hgext/evolve.py' >> ~/.hgrc
 
-You will probably want to use hgview_ to visualize obsolescence. Version 1.6.2
+You will probably want to use hgview_ to visualize obsolescence. Version 1.7.0
 or later is required.
 
 .. _hgview: http://www.logilab.org/project/hgview/
 
-(The old version 0.7 of evolve works with mercurial 2.2 but have far less feature)
-
 
  ---
 

File hgext/evolve.py

     ret = orig(ui, repo, *args, **kwargs)
     nbunstable = len(getrevs(repo, 'unstable'))
     nbbumped = len(getrevs(repo, 'bumped'))
-    nbdivergent = len(getrevs(repo, 'unstable'))
+    nbdivergent = len(getrevs(repo, 'divergent'))
     write('unstable: %i changesets\n', nbunstable)
     write('bumped: %i changesets\n', nbbumped)
     write('divergent: %i changesets\n', nbdivergent)
     """
     def selfanddescendants(repo, pctx):
         yield pctx
+        for prec in repo.set('allprecursors(%d)', pctx):
+            yield prec
         for ctx in pctx.descendants():
             yield ctx
+            for prec in repo.set('allprecursors(%d)', ctx):
+                yield prec
 
     # Look for an unstable which can be stabilized as a child of
     # node. The unstable must be a child of one of node predecessors.
     for ctx in selfanddescendants(repo, pctx):
-        unstables = list(repo.set('unstable() and children(allprecursors(%d))',
-                                  ctx.rev()))
-        if unstables:
-            return unstables[0]
+        for child in ctx.children():
+            if child.unstable():
+                return child
     return None
 
 def _solveunstable(ui, repo, orig, dryrun=False):
     """Stabilize a unstable changeset"""
     obs = orig.parents()[0]
     if not obs.obsolete():
+        print obs.rev(), orig.parents()
+        print orig.rev()
         obs = orig.parents()[1]
     assert obs.obsolete()
     newer = obsolete.successorssets(repo, obs.node())
         return 1
 
 @command('^prune|obsolete|kill',
-    [('n', 'new', [], _("successor changeset"))],
-    _('[OPTION] REV...'))
+    [('n', 'new', [], _("successor changeset")),
+     ('r', 'rev', [], _("revisions to fold"))],
+    _('[OPTION] [-r] REV...'))
 def kill(ui, repo, *revs, **opts):
     """mark a changeset as obsolete
 
     XXX handle merge
     XXX check immutable first
     """
+    revs = list(revs)
+    revs.extend(opts['rev'])
     wlock = repo.wlock()
     try:
         lock = repo.lock()
         lockmod.release(lock, wlock)
 
 @command('^fold',
-    [('r', 'rev', [], 'revisions to fold'),
+    [('r', 'rev', [], _("revisions to fold")),
     ],
     # allow to choose the seed ?
     _('[-r] revs'))
 
 setup(
     name='hg-evolve',
-    version='2.0.0',
+    version='2.99.0',
     author='Pierre-Yves David',
     maintainer='Pierre-Yves David',
     maintainer_email='pierre-yves.david@logilab.fr',

File tests/test-evolve.t

 
 test multiple kill
 
-  $ hg kill 4 3
+  $ hg kill 4 -r 3
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   working directory now at 7c3bad9141dc
   $ hg qlog

File tests/test-obsolete-divergent.t

   $ hg log -r 'divergent()'
   2:82623d38b9ba A_1
   3:392fd25390da A_2
+  $ hg summary -v
+  parent: 0:d20a80d4def3 
+   base
+  branch: default
+  commit: (clean)
+  update: 3 new changesets (update)
+  unstable: 0 changesets
+  bumped: 0 changesets
+  divergent: 2 changesets
+
 
 check that mercurial refuse to push
 

File tests/test-obsolete.t

   commit: 1 deleted, 2 unknown (clean)
   update: 4 new changesets, 4 branch heads (merge)
   unstable: 1 changesets
-  divergent: 1 changesets
   $ qlog
   6
   - 909a0fb57e5d

File tests/test-tutorial.t

   > # "-d '0 0'" means that the new commit will be at January 1st 1970.
   > # This is used for stable hash during test
   > amend = amend -d '0 0'
-  > [extensions]
-  > hgext.graphlog=
   > EOF
 
   $ hg init local
   $ hg showconfig diff
   diff.git=1
 
-And the graphlog extension
-  $ hg showconfig extensions
-  extensions.hgext.graphlog=
-
 And of course, we enable the experimental extensions for mutable history:
 
   $ cat >> $HGRCPATH <<EOF
 
 This history is very linear
 
-  $ hg glog
+  $ hg log -G
   @  d85de4546133 (draft): adding fruit
   |
   o  4d5dc8187023 (draft): adding condiment
 the outside. The first one have been exchanged and is an immutable public
 changeset.
 
-  $ hg glog
+  $ hg log -G
   @  d85de4546133 (draft): adding fruit
   |
   o  4d5dc8187023 (draft): adding condiment
   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   
 
-hopefully. I can use hg amend to rewrite my faulty changeset!
+hopefully. I can use `hg commit --amend` to rewrite my faulty changeset!
 
   $ sed -i'' -e s/Bananos/Banana/ shopping
   $ hg diff
   +Banana
    Pear
    Apple
-  $ hg amend
+  $ hg commit --amend
 
 A new changeset with the right diff replace the wrong one.
 
-  $ hg glog
-  @  0cacb48f4482 (draft): adding fruit
+  $ hg log -G
+  @  9d0363b81950 (draft): adding fruit
   |
   o  4d5dc8187023 (draft): adding condiment
   |
   # HG changeset patch
   # User test
   # Date 0 0
-  # Node ID 0cacb48f44828d2fd31c4e45e18fde32a5b2f07b
+  # Node ID 9d0363b81950646bc6ad1ec5de8b8197ea586541
   # Parent  4d5dc81870237d492284826e21840b2ca00e26d1
   adding fruit
   
   $ hg log -G
   o  9ca060c80d74 (public): SPAM
   |
-  | @  0cacb48f4482 (draft): adding fruit
+  | @  9d0363b81950 (draft): adding fruit
   | |
   | o  4d5dc8187023 (draft): adding condiment
   |/
 My local work is now rebased on the remote one.
 
   $ hg log -G
-  @  387187ad9bd9 (draft): adding fruit
+  @  41aff6a42b75 (draft): adding fruit
   |
   o  dfd3a2d7691e (draft): adding condiment
   |
   > EOF
   $ hg ci -m 'transport'
   $ hg log -G
-  @  d58c77aa15d7 (draft): transport
+  @  1125e39fbf21 (draft): transport
   |
-  o  387187ad9bd9 (draft): adding fruit
+  o  41aff6a42b75 (draft): adding fruit
   |
   o  dfd3a2d7691e (draft): adding condiment
   |
 
   $ hg prune . # . is for working directory parent
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory now at 387187ad9bd9
+  working directory now at 41aff6a42b75
 
 The silly changeset is gone.
 
   $ hg log -G
-  @  387187ad9bd9 (draft): adding fruit
+  @  41aff6a42b75 (draft): adding fruit
   |
   o  dfd3a2d7691e (draft): adding condiment
   |
   $ sed -i'' -e 's/Spam/Spam Spam Spam/g' shopping
   $ hg ci -m 'SPAM SPAM'
   $ hg log -G
-  @  c48f32fb1787 (draft): SPAM SPAM
+  @  fac207dec9f5 (draft): SPAM SPAM
   |
-  o  8d39a843582d (draft): bathroom stuff
+  o  10b8aeaa8cc8 (draft): bathroom stuff
   |
-  o  387187ad9bd9 (draft): adding fruit
+  o  41aff6a42b75 (draft): adding fruit
   |
   o  dfd3a2d7691e (draft): adding condiment
   |
   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   
 
-.. note: don't amend changeset 7e82d3f3c2cb or 9ca060c80d74 as they are immutable.
+.. note: We can't amend changeset 7e82d3f3c2cb or 9ca060c80d74 as they are immutable.
 
 I now want to push to remote all my change but the bathroom one that i'm not
 totally happy with yet. To be able to push "SPAM SPAM" I need a version of "SPAM SPAM" not children of
 
 You can use 'rebase -r' or 'graft -O' for that:
 
-  $ hg up 'p1(8d39a843582d)' # going on "bathroom stuff" parent
+  $ hg up 'p1(10b8aeaa8cc8)' # going on "bathroom stuff" parent
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ hg graft -O c48f32fb1787 # moving "SPAM SPAM" to the working directory parent
-  grafting revision 10
+  $ hg rebase --rev fac207dec9f5 --dest . # moving "SPAM SPAM" to the working directory parent
   merging shopping
   $ hg log -G
-  @  a2fccc2e7b08 (draft): SPAM SPAM
+  @  a224f2a4fb9f (draft): SPAM SPAM
   |
-  | o  8d39a843582d (draft): bathroom stuff
+  | o  10b8aeaa8cc8 (draft): bathroom stuff
   |/
-  o  387187ad9bd9 (draft): adding fruit
+  o  41aff6a42b75 (draft): adding fruit
   |
   o  dfd3a2d7691e (draft): adding condiment
   |
 
 We have a new SPAM SPAM version without the bathroom stuff
 
-  $ grep Spam shopping  # enouth spam
+  $ grep Spam shopping  # enough spam
   Spam Spam Spam Spam Spam Spam Spam Spam Spam
   $ grep Toothbrush shopping # no Toothbrush
   [1]
   # HG changeset patch
   # User test
   # Date 0 0
-  # Node ID a2fccc2e7b08bbce6af7255b989453f7089e4cf0
-  # Parent  387187ad9bd9d8f9a00a9fa804a26231db547429
+  # Node ID a224f2a4fb9f9f828f608959912229d7b38b26de
+  # Parent  41aff6a42b7578ec7ec3cb2041633f1ca43cca96
   SPAM SPAM
   
   diff --git a/shopping b/shopping
 To make sure I do not push unready changeset by mistake I set the "bathroom
 stuff" changeset in the secret phase.
 
-  $ hg phase --force --secret 8d39a843582d
+  $ hg phase --force --secret 10b8aeaa8cc8
 
 we can now push our change:
 
 
 for simplicity shake we get the bathroom change in line again
 
-  $ hg rebase -r 8d39a843582d -d a2fccc2e7b08
+  $ hg rebase -r 10b8aeaa8cc8 -d a224f2a4fb9f
   merging shopping
   $ hg phase --draft .
   $ hg log -G
-  @  8a79ae8b029e (draft): bathroom stuff
+  @  75954b8cd933 (draft): bathroom stuff
   |
-  o  a2fccc2e7b08 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
 Splitting change
 ------------------
 
-To be done (currently achieve with "two commit + debugobsolete")
+histedit or uncommit
 
 Collapsing change
 ------------------
 
-To be done (currently achieve with "revert + debugobsolete" or "rebase --collapse")
-
+This can be done with hg fold but the tutorial part is not written yet.
 
 
 
   added 1 changesets with 1 changes to 1 files
   (run 'hg update' to get a working copy)
   $ hg log -G
-  o  8a79ae8b029e (public): bathroom stuff
+  o  75954b8cd933 (public): bathroom stuff
   |
-  o  a2fccc2e7b08 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
   $ hg rollback
   repository tip rolled back to revision 4 (undo pull)
   $ hg log -G
-  o  a2fccc2e7b08 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
   added 1 changesets with 1 changes to 1 files
   (run 'hg update' to get a working copy)
   $ hg log -G
-  o  8a79ae8b029e (draft): bathroom stuff
+  o  75954b8cd933 (draft): bathroom stuff
   |
-  o  a2fccc2e7b08 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
 
 Remotely someone add a new changeset on top of the mutable "bathroom" on.
 
-  $ hg up 8a79ae8b029e -q
+  $ hg up 75954b8cd933 -q
   $ cat >> shopping << EOF
   > Giraffe
   > Rhino
 But at the same time, locally, this same "bathroom changeset" was updated.
 
   $ cd ../local
-  $ hg up 8a79ae8b029e -q
+  $ hg up 75954b8cd933 -q
   $ sed -i'' -e 's/... More bathroom stuff to come/Bath Robe/' shopping
-  $ hg amend
+  $ hg commit --amend
   $ hg log -G
-  @  ffa278c50818 (draft): bathroom stuff
+  @  a44c85f957d3 (draft): bathroom stuff
   |
-  o  a2fccc2e7b08 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
 see both version showing up in the log.
 
   $ hg log -G
-  o  9ac5d0e790a2 (draft): animals
+  o  bf1b0d202029 (draft): animals
   |
-  | @  ffa278c50818 (draft): bathroom stuff
+  | @  a44c85f957d3 (draft): bathroom stuff
   | |
-  x |  8a79ae8b029e (draft): bathroom stuff
+  x |  75954b8cd933 (draft): bathroom stuff
   |/
-  o  a2fccc2e7b08 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
   o  7e82d3f3c2cb (public): Monthy Python Shopping list
   
 
-The older version 8a79ae8b029e never ceased to exist in the local repo. It was
+The older version 75954b8cd933 never ceased to exist in the local repo. It was
 jsut hidden and excluded from pull and push.
 
-.. note:: In hgview there is a nice doted relation highlighting ffa278c50818 as a new version of 8a79ae8b029e. this is not yet ported to graphlog.
+.. note:: In hgview there is a nice doted relation highlighting a44c85f957d3 as a new version of 75954b8cd933. this is not yet ported to graphlog.
 
 Their is **unstable** changeset in this history now. Mercurial will refuse to
 share it with the outside:
   $ hg push other
   pushing to $TESTTMP/other
   searching for changes
-  abort: push includes unstable changeset: 9ac5d0e790a2!
+  abort: push includes unstable changeset: bf1b0d202029!
   (use 'hg evolve' to get a stable history or --force to ignore warnings)
   [255]
  
 
 
 
-To resolve this unstable state, you need to rebase 9ac5d0e790a2 onto
-ffa278c50818 the "hg evolve" command will make this for you.
+To resolve this unstable state, you need to rebase bf1b0d202029 onto
+a44c85f957d3 the "hg evolve" command will make this for you.
 
 It has a --dry-run option to only suggest the next move.
 
   $ hg evolve --dry-run
   move:[15] animals
   atop:[14] bathroom stuff
-  hg rebase -r 9ac5d0e790a2 -d ffa278c50818
+  hg rebase -r bf1b0d202029 -d a44c85f957d3
 
 Let's do it
 
-  $ hg rebase -r 9ac5d0e790a2 -d ffa278c50818
+  $ hg evolve
+  move:[15] animals
+  atop:[14] bathroom stuff
   merging shopping
 
 The old version of bathroom is hidden again.
 
   $ hg log -G
-  @  437efbcaf700 (draft): animals
+  @  ee942144f952 (draft): animals
   |
-  o  ffa278c50818 (draft): bathroom stuff
+  o  a44c85f957d3 (draft): bathroom stuff
   |
-  o  a2fccc2e7b08 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
   no changes found
   Working directory parent is obsolete
 
-  $ hg up 437efbcaf700
+  $ hg up ee942144f952
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Relocating unstable change after prune
   added 1 changesets with 1 changes to 1 files
   (run 'hg update' to get a working copy)
   $ hg log -G
-  o  ae45c0c3092a (draft): SPAM SPAM SPAM
+  o  99f039c5ec9e (draft): SPAM SPAM SPAM
   |
-  @  437efbcaf700 (draft): animals
+  @  ee942144f952 (draft): animals
   |
-  o  ffa278c50818 (draft): bathroom stuff
+  o  a44c85f957d3 (draft): bathroom stuff
   |
-  o  a2fccc2e7b08 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
 
 In the mean time I noticed you can't buy animals in a super market and I prune the animal changeset:
 
-  $ hg prune 437efbcaf700
+  $ hg prune ee942144f952
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory now at ffa278c50818
+  working directory now at a44c85f957d3
   1 new unstable changesets
 
 
 is neither dead or obsolete.  My repository is in an unstable state again.
 
   $ hg log -G
-  o  ae45c0c3092a (draft): SPAM SPAM SPAM
+  o  99f039c5ec9e (draft): SPAM SPAM SPAM
   |
-  x  437efbcaf700 (draft): animals
+  x  ee942144f952 (draft): animals
   |
-  @  ffa278c50818 (draft): bathroom stuff
+  @  a44c85f957d3 (draft): bathroom stuff
   |
-  o  a2fccc2e7b08 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
   
 
   $ hg log -r 'unstable()'
-  ae45c0c3092a (draft): SPAM SPAM SPAM
+  99f039c5ec9e (draft): SPAM SPAM SPAM
 
-  $ hg evolve --any
+  $ hg evolve
   move:[17] SPAM SPAM SPAM
   atop:[14] bathroom stuff
   merging shopping
 
   $ hg log -G
-  @  d6717f710962 (draft): SPAM SPAM SPAM
+  @  40aa40daeefb (draft): SPAM SPAM SPAM
   |
-  o  ffa278c50818 (draft): bathroom stuff
+  o  a44c85f957d3 (draft): bathroom stuff
   |
-  o  a2fccc2e7b08 (public): SPAM SPAM
+  o  a224f2a4fb9f (public): SPAM SPAM
   |
-  o  387187ad9bd9 (public): adding fruit
+  o  41aff6a42b75 (public): adding fruit
   |
   o  dfd3a2d7691e (public): adding condiment
   |
 Handling Conflicting amend
 ----------------------------------------------
 
-We can detect that multiple diverging//conflicting amend have been made. There
-will be a "evol-merge" command to merge conflicting amend
+We can detect that multiple diverging//conflicting amend have been made.
+hg evolve is able to solve several of them
 
-This command is not ready yet.
+This section need to be written