README
author Pulkit Goyal <7895pulkit@gmail.com>
Sun, 18 Mar 2018 23:48:06 +0530
changeset 3660 f018656ca3bf
parent 3071 472a67075756
child 3766 6352dc395ebf
permissions -rw-r--r--
amend: add a new flag `--patch` to `hg amend` This patch adds a new flag `--patch` to `hg amend` which pops up an editor with the patch of working directory parent which you can change, and when you exit the editor the patch with changes is applied to current working directory with old changeset being obsoleted in favour of new one created by the applied patch. If supplied filenames, only those filenames are present in the popped editor and rest files stay the same way in the commit as they were. The extension of the file which opens up in editor is '.diff', we cannot have it as '.patch' as there will be develwarns related to that. We need to change to patch core and undo some change to achieve this. The implementation does not use any core API rather it has picked chunks from API which are required. One main reason to not use core import API is that we have to change wdir parent before using patch.patch() which I will like to avoid to make sure we handle merge cases too. While writing this patch I have spend lot of time try to use internal API's to work for this but none of them served the purpose well. If I have time in future and work on similar problem again, I am going to write better high-level API's which uses patchstore to achieve this. A new test file test-amend-patch.t which contains a lot of testing of the feature.

=============================
Mutable History For Mercurial
=============================

Evolve Extension
=================

This package supplies the ``evolve`` extension for Mercurial,

**The full implementation of the changeset evolution concept is still in
progress.**  Please subscribe to the `evolve-testers mailing list
<https://www.mercurial-scm.org/mailman/listinfo/evolve-testers>`_ to stay up to
date with changes.

This extension:

* enables the “changeset evolution” feature of Mercurial core,

* provides a set of commands to mutate your history,

* issues several warning messages when troubles from some mutable appears in
  your repository,

* provides an ``hg evolve`` command to deal with such "troubles",

* improves performance of obsolescence marker exchanges and discovery during
  push and pull.

Documentation
-------------

We recommend reading the documentation first. An online version is
available here:

    https://www.mercurial-scm.org/doc/evolution/

How to Install
==============

Using Pip
---------

You can install the latest evolution version usin pip::

    $ pip install --user hg-evolve

Then just enable it in you hgrc::

    $ hg config --edit # adds the two line below:
    [extensions]
    evolve =

From Source
-----------

To install a local version from source::

    $ hg clone https://www.mercurial-scm.org/repo/evolve/
    $ cd evolve
    $ pip install --user .

Then just enable it in you hgrc::

    $ hg config --edit # adds the two line below:
    [extensions]
    evolve =

Documentation lives in ``doc/``.

Server Only Setup
=================

It is possible to enable a smaller subset of the extensions aimed at server
serving repository. It skips the additions of the new commands and local UI
messages that might add performance overheads. To use the server only
extension, install the package and use::

    $ hg config --edit # adds the two line below:
    [extensions]
    evolve.serveronly =


How to Contribute
=================

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
<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>'

For guidelines on the patch description, see the `official Mercurial guideline`_.

.. _`official Mercurial guideline`: https://mercurial-scm.org/wiki/ContributingChanges#Patch_descriptions

Please don't forget to update and run the tests when you fix a bug or
add a feature. To run the tests, you need a working copy of Mercurial,
say in $HGSRC::

    $ cd tests
    $ python $HGSRC/tests/run-tests.py

Branch policy
-------------

The evolve test are highly impacted by changes in core. To deal with this, we use named branches.

There are two main branches: "stable" and "default". Tests on these branch are
supposed to pass with the corresponding "default" and "stable" branch from core
Mercurial. The documentation is built from the tip of stable.

In addition, we have compatibility branches to check tests on older version of
Mercurial. They are the "mercurial-x.y" branches. They are used to apply
expected test change only, no code change should happen there.