Note:

This page is primarily intended for developers of Mercurial.

API Changes

Notable changes in Mercurial's API.

1. How to keep your extension compatible

def updatedir(*args, **kwargs):
    if hasattr(patch, 'updatedir'):
        patch.updatedir(*args, **kwargs)
    else:
        cmdutil.updatedir(*args, **kwargs)

2. Changes in 4.8rc0

3. Changes in 3.9

4. Changes in 3.8

5. Changes in 3.7

6. Changes in 3.6

7. Changes in 3.2

8. Changes in 3.1

9. Changes after 2.8

10. Changes after 2.4

11. Changes after 2.3

12. Changes after 2.2

13. Changes between 1.9 and 2.2

?

14. Changes after 1.9

15. Changes after 1.8

16. Changes after 1.7

17. Changes after 1.6

18. Changes after 1.5

19. Changes after 1.4

20. Changes after 1.3

21. Changes from 1.2 to 1.3

    # before
    ui = ui.ui(parentui=parentui, interactive=False)

    # after
    ui = baseui.copy() # there's no longer a parent/child concept
    ui.setconfig('ui', 'interactive', 'off')

22. Changes from 1.1 to 1.2

23. Changes from 1.0 to 1.1

    # before
    for src, abs, rel, exact in cmdutil.walk(repo, pats, opts,
                                             node=ctx.node()):

    # after

    m = cmdutil.match(repo, pats, opts)
    for abs in ctx.walk(m):
        rel = m.rel()

    # before
    def status(self, node1=None, node2=None, files=[], match=util.always,
               list_ignored=False, list_clean=False, list_unknown=True):

    # after
    def status(self, node1='.', node2=None, match=None,
               ignored=False, clean=False, unknown=False):

    # before
    a = manifest.linkrev(node)
    b = manifest.linkrev(manifest.node(rev))

    # after
    a = manifest.linkrev(manifest.rev(node))
    b = manifest.linkrev(rev)

    # before
    displayer = cmdutil.show_changeset(ui, repo, opts)
    displayer.show(rev, node)

    # after
    displayer = cmdutil.show_changeset(ui, repo, opts)
    displayer.show(repo[rev])

    # before
    keep = { }
    patch.applydiff(..., keep, ...)

    print keep
    { 'fname': ( action, other ) }

    # after
    keep = { }
    patch.applydiff(..., keep, ...)

    print keep
    { 'fname': action }

as before, action will only be set to anything not-None if the patch is in git-format.

23.1. Template changes in 1.0

If you use your own template set (particularly for hgweb), here are some relevant changes.

24. See also


CategoryInternals

ApiChanges (last edited 2018-11-02 13:59:39 by AntonShestakov)