Mercurial 4.6 release
1. Backwards Compatibility Changes
- Support for connecting to Mercurial servers older than 0.9.1 has been
- removed.
- Working-directory commands now respect "-X PATTERN" no matter if PATTERN
- matches explicitly-specified FILEs. For example, "hg add foo -X foo" no longer add the file "foo".
- Support for the experimental manifestv2 format has been removed, as it was
- never completed and failed to meet expectations.
- '{' in output filename passed to archive/cat/export is taken as a start of a
- template expression.
- The HTTP wire protocol server no longer accepts the "cmd" argument to
- control which command to run via HTTP POST bodies. The "cmd" argument must be specified on the URL query string.
- Hgweb no longer reads form data in POST requests from multipart/form-data
- and application/x-www-form-urlencoded requests. Arguments should be specified as URL path components or in the query string in the URL instead.
- Query string shorts in hgweb like "?cs=@" have been removed. Use URLs of the
- form "/:cmd" instead.
- The HTTP client no longer accepts text/plain and application/hg-changegroup
- Content-Type values as a valid Mercurial command response. These should only be encountered on pre 1.0 Mercurial servers.
2. Performance Improvements
- 'hg manifest --all' is likely slower due to changing its implementation to
- respect storage interface boundaries. If you are impacted by this regression in a meaningful way, please make noise on the development mailing list and it can be dealt with.
3. API Changes
- Content from mercurial.hgweb.protocol has been moved to
- mercurial.wireprotoserver.
- Content from mercurial.sshserver has been moved into
- mercurial.wireprotoserver.
- sshserver no longers looks for wire protocol command handlers in methods
named do_<command>. Use @wireproto.wireprotocommand to declare wire protocol command handler functions.
- Log-related utility functions has been renamed as follows:
- cmdutil.loglimit -> logcmdutil.getlimit
- cmdutil.diffordiffstat -> logcmdutil.diffordiffstat
- cmdutil._changesetlabels -> logcmdutil.changesetlabels
- cmdutil.changeset_printer -> logcmdutil.changesetprinter - cmdutil.jsonchangeset = logcmdutil.jsonchangeset
- cmdutil.changeset_templater -> logcmdutil.changesettemplater
- cmdutil.logtemplatespec -> logcmdutil.templatespec
- cmdutil.makelogtemplater -> logcmdutil.maketemplater
- cmdutil.show_changeset -> logcmdutil.changesetdisplayer
- cmdutil.getlogrevs -> logcmdutil.getrevs
- cmdutil.getloglinerangerevs -> logcmdutil.getlinerangerevs
- cmdutil.displaygraph -> logcmdutil.displaygraph
- cmdutil.graphlog -> logcmdutil.graphlog
- cmdutil.checkunsupportedgraphflags -> logcmdutil.checkunsupportedgraphflags
- cmdutil.graphrevs -> logcmdutil.graphrevs
- cmdutil._makenofollowlogfilematcher -> logcmdutil._makenofollowfilematcher
- The following deprecated methods have been removed from context, with
- replacements:
- unstable() -> orphan()
- bumped() -> phasedivergent()
- divergent() -> contentdivergent()
- troubled() -> isunstable()
- troubles() -> instabilities()
- replacements:
- The following deprecated methods have been removed from obsolete, with
- replacements:
- _addprecursors() -> _addpredecessors()
- obsstore.precursors -> obsstore.predecessors
- allprecursors() -> obsutil.allprecursors()
- allsuccessors() -> obsutil.allsuccessors()
- marker() -> obsutil.marker
- getmarkers() -> obsutil.getmarkers()
- exclusivemarkers() -> obsutil.exclusivemarkers()
- foreground() -> obsutil.foreground()
- successorssets() -> obsutil.successorsset()
- unstable() -> orphan()
- bumped() -> phasedivergent()
- divergent() -> contentdivergent()
- replacements:
- The following deprecated methods have been removed from obsutil:
- marker.precnode() and allprecursors(). Use marker.prednode() and allpredecessors() instead.
- beginparentchange() and endparentchange() have been replaced by the
- parentchange context manager.
- The deprecated localrepo.walk() has been removed, and replaced by
- repo[node].walk().
- The following deprecated methods have been removed from bookmarks:
setitem(), delitem(), update(), and recordchange(). Use bookmarks.applychanges() instead.
- The cmdutil._revertprefetch() hook point for prefetching stored files has
- been replaced by the command agnostic cmdutil._prefetchfiles(). The new function takes a list of files, instead of a list of lists of files.
sshpeer.sshpeer.init now receives arguments describing an existing
- connection instead of creating a connection itself.
- sshpeer.sshpeer renamed to sshpeer.sshv1peer.
- "wireproto.pushres" and "wireproto.pusherr" now explicitly track stdio
- output.
- redirect() and restore() have been removed from the wire protocol handler
- interface. Use mayberedirectstdio() instead.
- The "_client()" method of the wire protocol handler interface has been
- renamed to "client()".
- Wire protocol command handlers now return a wireprototypes.bytesresponse
- instead of a raw bytes instance. Protocol handlers will continue handling bytes instances. However, any extensions wrapping wire protocol commands will need to handle the new type.
- SSH protocol handler now advertises its name internally as "ssh-v1" instead
- of "ssh."
- File prefetching is now handled by registering a callback with
- scmutil.fileprefetchhooks.
- HTTP protocol handlers now advertises its internal name as "http-v1" instead
- of "http".
context.basectx no longer implements int. Context instances will no
- longer cast to ints. Consumers should call "ctx.rev()" instead.
- templatekw.showdict() and showlist() are deprecated in favor of new
- (context, mapping) API. Switch the keyword function to new API and use templatekw.compatdict() and compatlist() instead.
- hgweb_mod.perms and wireproto.permissions have been removed. Wire protocol
- commands should declare their required permissions in the @wireprotocommand decorator.
- The WSGI request object no longer exposes a "form" attribute containing
- parsed query string data. Use the "qsparams" attribute instead.
- hgweb.hgweb_mod.permhooks no longer take a "wsgirequest" instance as an
- argument.
- hgweb @webcommand functions must use the new response object passed in via
- "web.res" to initiate sending of a response. The hgweb WSGI application will no longer start sending the response automatically.
- Various helper functions in hgweb.webutil no longer accept a templater
- instance. Access the templater through the "web" argument instead.
- Various functions in hgweb.webutil now take a modern request object instead
- of "wsgirequest".
- @webcommand functions now only receive a single argument. The request and
- templater instances can be accessed via the "req" and "templater" attributes of the first argument. Note that the request object is different from previous Mercurial releases and consumers of the previous "req" 2nd argument will need updating to use the new API.
- The old "wsgirequest" class for handling everything WSGI in hgweb has been
- replaced by separate request and response types. Various high-level functions in the hgweb WSGI applications now receive these new types as arguments instead of the old "wsgirequest" type.
- The "render(mapping)" method of the templater has been renamed to
- "renderdefault(mapping)".
httppeer.httppeer.init now takes additional arguments. Instances should
- be obtained by calling httppeer.instance() or httppeer.makepeer() instead.
- The templater is no longer callable. Use "templater.generate(t, mapping)"
- instead of "templater(t, **pycompat.strkwargs(mapping))".
- "templatekw._showlist()" is deprecated in favor of
- "templateutil._showcompatlist()", which takes "context" in place of "templ".
- Several generic string helper functions have been moved to utils.stringutil
- module.
- The util.Abort alias has been removed. Use error.Abort.
- merge.update() and merge.applyupdates() now return a class with named
- attributes instead of a tuple. Switch consumers to access elements by name instead of by offset.
- Utility functions related to process/executable management have been moved
- to utils.procutil module.
- localrepo.localrepository.featuresetupfuncs has been renamed to
- localrepo.featuresetupfuncs.
- localrepo.localrepository.filterpats was renamed to
- localrepo.localrepository._filterpats.
Template filters should declare input data type and/or catch AttributeError,
ValueError, TypeError, etc. as needed. See the doc of "registrar.templatefilters" for details.
- "wireproto" module no longer re-exports various types used to define
- responses to wire protocol commands. Access these types from the "wireprototypes" module.
- filelog.parsemeta() and filelog.packmeta() have been moved to the revlog
- module.
- "procutil.popen()" no longer supports text mode I/O.
- "hook.hook()" and "hook.runhooks()" may return a negative integer to denote
- that the process was killed by signal.
- filelog.filelog is now a standalone class and doesn't inherit from revlog.
- Instead, it wraps a revlog instance at self._revlog. This change was made in an attempt to formalize storage APIs and prevent revlog implementation details leaking through to callers.
- The "fp" argument is removed from "cmdutil.export()". Use
- "cmdutil.exportfile()" instead.
- "cmdutil.export()" takes a formatter as an argument.
- "patch.extract()" is now a context manager. Callers no longer have to worry
- about deleting the temporary file it creates, as the file is tied to the lifetime of the context manager.
- The wire protocol peer's "iterbatch()" for bulk executing commands has been
- remove.d Use "peer.commandexecutor()" instead.