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 3.9

3. Changes in 3.8

4. Changes in 3.7

5. Changes in 3.6

6. Changes in 3.2

7. Changes in 3.1

8. Changes after 2.8

9. Changes after 2.4

10. Changes after 2.3

11. Changes after 2.2

12. Changes between 1.9 and 2.2

?

13. Changes after 1.9

14. Changes after 1.8

15. Changes after 1.7

16. Changes after 1.6

17. Changes after 1.5

18. Changes after 1.4

19. Changes after 1.3

20. 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')

21. Changes from 1.1 to 1.2

22. 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.

22.1. Template changes in 1.0

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

23. See also


CategoryInternals