[PATCH 3 of 4 V3] tags: add mergemode flag to _readtags

Matt Mackall mpm at selenic.com
Thu Jun 26 18:38:24 CDT 2014


On Thu, 2014-06-26 at 01:22 +0200, Angel Ezquerra wrote:
> # HG changeset patch
> # User Angel Ezquerra <angel.ezquerra at gmail.com>
> # Date 1403677632 -7200
> #      Wed Jun 25 08:27:12 2014 +0200
> # Node ID 488f01d33770c338ebe987b4efbd986b0ef91ed0
> # Parent  10ffd0db8fea2e7324233136b262822e775c45a5
> tags: add mergemode flag to _readtags
...
> +    The output changes depending on the mergemode flag:
> +    - When mergemode is False (the default), return a mapping from tag name to
> +      (node, hist): node is the node id from the last line read for that name,
> +      and hist is the list of node ids previously associated with it (in file
> +      order).  All node ids are binary, not hex.
> +    - When mergemode is True, return a mapping from tag name to a list of
> +      [hexnode, line number] pairs, ordered from the oldest to the newest node.
> +      hex node is hex not binary.
> +      '''

I generally frown on functions that change return type based on
argument. Perhaps we can have:

_readtags() -> _readtagshist()

..assuming the overhead of tracking the extra history isn't too high.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list