[PATCH 1 of 5 V5] template: compute verb in obsfateverb

Martin von Zweigbergk martinvonz at google.com
Wed Aug 30 02:13:02 EDT 2017


On Mon, Aug 28, 2017 at 12:59 PM, Boris Feld <boris.feld at octobus.net> wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld at octobus.net>
> # Date 1499088807 -7200
> #      Mon Jul 03 15:33:27 2017 +0200
> # Node ID 3aa34cf79eafaf1f3831dbfcc0891e4432df780e
> # Parent  e43264525ce513dab1ea23e39d2cf1051975c8ca
> # EXP-Topic obsfatetemplate
> template: compute verb in obsfateverb
>
> Add a template function obsfateverb which use the markers information to
> compute a better obsfate verb.
>
> The current logic behind the obsfate verb is simple for the moment:
>
> - If the successorsets is empty, the changeset has been pruned, for example:
>
>     Obsfate: pruned
>
> - If the successorsets length is 1, the changeset has been rewritten without
>   divergence, for example:
>
>     Obsfate: rewritten as 2:337fec4d2edc, 3:f257fde29c7a
>
> - If the successorsets length is more than 1, the changeset has diverged, for
>   example:
>
>     Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a

Why do we say "split" and not "diverged"?

>
> As the divergence might occurs on a subset of successors, we might see some
> successors twice:
>
>     Obsfate: split as 9:0b997eb7ceee, 5:dd800401bd8c, 10:eceed8f98ffc; split
>     as 8:b18bc8331526, 5:dd800401bd8c, 10:eceed8f98ffc
>
> diff -r e43264525ce5 -r 3aa34cf79eaf mercurial/obsutil.py
> --- a/mercurial/obsutil.py      Tue Aug 22 23:39:05 2017 -0700
> +++ b/mercurial/obsutil.py      Mon Jul 03 15:33:27 2017 +0200
> @@ -582,3 +582,14 @@
>          values.append({'successors': sset, 'markers': sset.markers})
>
>      return values
> +
> +def successorsetverb(successorset):
> +    """ Return the verb summarizing the successorset
> +    """
> +    if not successorset:
> +        verb = 'pruned'

Should these strings be internationalized?


More information about the Mercurial-devel mailing list