Patchwork [urgent,regression,on,default] obsolete: properly drop 'date' from metadata

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 10, 2014, 6:42 p.m.
Message ID <d7fe9bd4963686841465.1410374535@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5769/
State Accepted
Headers show

Comments

Pierre-Yves David - Sept. 10, 2014, 6:42 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1410356572 -3600
#      Wed Sep 10 14:42:52 2014 +0100
# Node ID d7fe9bd4963686841465595b8065afeae633aa92
# Parent  293930a1fa0a52d9bef832e72ef4c505b74e0c64
obsolete: properly drop 'date' from metadata

Mistakes were made while resolving rebase conflict in 4bc96685a40c. This lead to
'date' being preserved in metadata when reading marker from a binary stream.

As a result some known markers were seen as "new" when pulling. I noticed it
because a no-op pulls from main added about 600 duplicated markers to my
obsstore (for each pull).

I do not believe we need to perform any specific action to actively
de-duplicates existing obsstore. After this fix, duplicated markers will no be
propagated and the fewaffected repo can probably deal with duplication (or
people can repull the obsstore from a clone).

As a side effect, we decode metadata only once, reducing the impact of the hack
in fm0 to store extra important data (parents and date).
Augie Fackler - Sept. 10, 2014, 7:05 p.m.
On Wed, Sep 10, 2014 at 08:42:15PM +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1410356572 -3600
> #      Wed Sep 10 14:42:52 2014 +0100
> # Node ID d7fe9bd4963686841465595b8065afeae633aa92
> # Parent  293930a1fa0a52d9bef832e72ef4c505b74e0c64
> obsolete: properly drop 'date' from metadata

Queued, thanks.

>
> Mistakes were made while resolving rebase conflict in 4bc96685a40c. This lead to
> 'date' being preserved in metadata when reading marker from a binary stream.
>
> As a result some known markers were seen as "new" when pulling. I noticed it
> because a no-op pulls from main added about 600 duplicated markers to my
> obsstore (for each pull).
>
> I do not believe we need to perform any specific action to actively
> de-duplicates existing obsstore. After this fix, duplicated markers will no be
> propagated and the fewaffected repo can probably deal with duplication (or
> people can repull the obsstore from a clone).
>
> As a side effect, we decode metadata only once, reducing the impact of the hack
> in fm0 to store extra important data (parents and date).
>
> diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
> --- a/mercurial/obsolete.py
> +++ b/mercurial/obsolete.py
> @@ -179,11 +179,11 @@ def _fm0readmarkers(data, off=0):
>                                 'short, %d bytes expected, got %d')
>                               % (mdsize, len(metadata)))
>          off += mdsize
>          meta = decodemeta(metadata)
>          try:
> -            when, offset = decodemeta(metadata).pop('date', '0 0').split(' ')
> +            when, offset = meta.pop('date', '0 0').split(' ')
>              date = float(when), int(offset)
>          except ValueError:
>              date = (0., 0)
>          parents = None
>          if 'p2' in meta:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -179,11 +179,11 @@  def _fm0readmarkers(data, off=0):
                                'short, %d bytes expected, got %d')
                              % (mdsize, len(metadata)))
         off += mdsize
         meta = decodemeta(metadata)
         try:
-            when, offset = decodemeta(metadata).pop('date', '0 0').split(' ')
+            when, offset = meta.pop('date', '0 0').split(' ')
             date = float(when), int(offset)
         except ValueError:
             date = (0., 0)
         parents = None
         if 'p2' in meta: