Mercurial > evolve
view docs/evolve-faq.rst @ 4728:ef8907df73fc stable
touch: fix the inconsistent behavior of divergence catching logic (issue6107)
When touching a node, the way we check if it can lead to divergence
is we look at the successors sets of the rev being touched. And if
there is successor revs exists (excluding the case when that successor
set is (A,) for rev A) that means there will be divergence and we warn
the user.
This works fine but there is still a case (which is not covered by looking
at successor sets) which can lead to divergence.
That case is: when there is already a revision exists which is divergent
to the revision being touched. And performing the touch would revive
that "dead" divergence. (Dead because one of the revision is obsolete which
is the one we are touching)
And to see if there is any rev which is divergent to a particular rev
we already have a function which we can use here
i.e. `evolvecmd.divergentsets(repo, ctx_being_touched)`
Changes in test file demonstrate the fixed behaviour.
author | Sushil khanchi <sushilkhanchi97@gmail.com> |
---|---|
date | Wed, 17 Jul 2019 17:58:44 +0200 |
parents | 8784dfc6537c |
children | 3968f6d58591 |
line wrap: on
line source
.. Copyright 2011 Pierre-Yves David <pierre-yves.david@ens-lyon.org> .. Logilab SA <contact@logilab.fr> ------------- Evolve How To ------------- Add a changeset: ``commit`` --------------------------- Just use commit as usual. New changesets will be in the `draft` phase. Rewrite a changeset: ``commit --amend`` --------------------------------------- It writes a new changeset combining working-directory parent changes and parent. It will work on any `draft` or `secret` changeset. It will not work on `public` changesets. To understand what the result of amend will be I use the two following aliases [#]_:: # diff what amend will look like pdiff=diff --rev .^ # status what amend will look like pstatus=status --rev .^ This command can even be invoked on changesets with children, provided none are public. .. [#] (defined by the evolve extension for you) Move a changeset: ``grab`` -------------------------- You can use ``hg grab <rev>`` to move a rev at your current location, making the old version obsolete. .. note:: grab is an alias for ``hg rebase --dest . --rev $@; hg up <result>`` Delete a changeset: ``prune`` ----------------------------- A new ``prune`` command allows removing a changeset. Just use ``hg prune <some-rev>``. Moving within the history: ``gdown`` and ``gup`` ------------------------------------------------ While working on mutable part of the history you often need to move between mutable commits. You just need to use standard update to work with evolve. For convenience, you can use ``hg gup`` to move to the child commit or ``hg gdown`` to move to the parent commit. Those command have ``previous`` and ``next`` alias. .. note:: Those commands only exist for the convenience of getting qpush and qpop feeling back. Collapse changesets: ``fold`` ----------------------------- You can use ``hg fold`` to collapse multiple changesets in a single one. It takes two forms: ``hg fold <rev>`` folds everything from you current changeset to `<rev>` ``hg fold -r <revset>`` fold everything changeset matching the revset together. Getting changes out of a commit ------------------------------- The ``hg uncommit`` command lets you rewrite the parent commit without selected changed files. Target files content is not altered and appears again as "modified":: $ hg st M babar M celestine $ hg commit babar celestine $ hg st $ hg uncommit celestine $ hg status M celestine Split a changeset ----------------- To split on file boundaries, just use ``uncommit`` command. If you need a fine-grained split, there is no official command for that yet. However, it is easily achieved by manual operation:: ### you want to split changeset A: 42 # update to A parent $ hg up 42^ # restore content from A $ hg revert -r 42 --all # partially commit the first part $ hg record # commit the second part $ hg commit # informs mercurial of what happened # current changeset (.) and previous one (.^) replace A (42) $ hg prune --new . --new .^ 42 For more complexe scenario we recommend the use of the histedit_ extension. .. _histedit: https://www.mercurial-scm.org/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 will, eventually, import new changesets in your tree. And it is likely that you will want your work in progress changesets to be rebased on the top of this newly imported subtree. Doing so is only a matter of rebasing. Move multiple changesets: ``rebase`` ------------------------------------ You can still use rebase to move a whole segment of the changeset graph together. .. warning:: Beware that rebasing changesets already obsolete will likely result in content-divergent versions of the changesets. Resolve history instability: ``evolve`` --------------------------------------- When you rewrite (amend) a changeset with children without rewriting those children you create *orphan* changesets and *suspended obsolete* changesets. When you are finished amending a given changeset, you will want to declare it stable, in other words rebase its former descendants on its newest version. You can also use evolve to solve `phase-divergent` and `content-divergent` changeset/ Fix my history afterward: ``prune -n`` -------------------------------------- Sometimes you need to create an obsolete marker by hand. This may happen when upstream has applied some of your patches for example. you can use ``hg prune <old-changeset> --succ <new-changeset>`` to add obsolete marker. View diff from the last amend ----------------------------- An ``odiff`` alias have been added by ``enable.sh`` :: [alias] odiff = diff --rev 'limit(predecessors(.),1)' --rev . View obsolete markers --------------------- hgview_ is the only viewer that currently supports this feature. You need version 1.6.2 .. _hgview: http://www.logilab.org/project/hgview/ .. image:: figures/hgview-example.png :scale: 50% You can also use a debug command $ hg debugobsolete 5eb72dbe0cb4 e8db4aa611f6 c4cbebac3751 4f1c269eab68 Important Note ============== View change to your file ------------------------ Extinct changesets are hidden using the *hidden* feature of mercurial. Only ``hg log`` and ``hgview`` support it, other graphical viewer do not. You can use ``hg log --graph --hidden`` from the command line