Differences between revisions 3 and 4
Revision 3 as of 2008-11-14 17:38:25
Size: 1294
Comment: Refine previous refinement.
Revision 4 as of 2008-11-14 18:30:59
Size: 1966
Comment: Some notes about template changes.
Deletions are marked like this. Additions are marked like this.
Line 37: Line 37:

=== Template changes in 1.0 ===

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

 * Before 1.0, Content-Type was set as a line in header.tmpl. It was changed in 1.0 to use a "mimetype" value from the map. In 1.1, the old behavior has been removed.
 * Annotate templates now get a full user instead of the short version. Use "author|user" to revert to the previous behavior.
 * Annotate lines now also have the "desc" variable, in order to show the commit message for that line's changeset.
 * Parent and child links (in changeset and diff pages, for example) can now show much more information about those changesets.

Because Mercurial's internals are steadily evolving to be simpler and more consistent, we have not yet provided a guaranteed-stable API. This page describes Mercurial internal changes on the development branch to help third-party developers update their code.

Changes post-1.0

  • repo.count(), changelog.count(), and revlog.count() replaced with len() method
  • introduction of repo[identifier] and revlog[identifier]
  • replace all users of util.matcher with match objects
  • changed cmdutil.walk to repo.walk:

    # 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()
  • changed defaults for localrepo.status:

    # 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):
  • patch.diff() no longer accepts an fp argument, it yields data instead
  • len(changectx.parents()) may now be of length 1 (but never length 0)

1. Template changes in 1.0

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

  • Before 1.0, Content-Type was set as a line in header.tmpl. It was changed in 1.0 to use a "mimetype" value from the map. In 1.1, the old behavior has been removed.
  • Annotate templates now get a full user instead of the short version. Use "author|user" to revert to the previous behavior.
  • Annotate lines now also have the "desc" variable, in order to show the commit message for that line's changeset.
  • Parent and child links (in changeset and diff pages, for example) can now show much more information about those changesets.

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