Patchwork D9445: sidedata: send the correct revision data for wireproto v2

login
register
mail settings
Submitter phabricator
Date Nov. 28, 2020, 2:05 p.m.
Message ID <differential-rev-PHID-DREV-zgly6yftt2sdlaebxa6g-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47723/
State Superseded
Headers show

Comments

phabricator - Nov. 28, 2020, 2:05 p.m.
joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  When no sidedata is present, rawdata() and revision() are the same. But
  as soon as sidedata is present, the way it is currently stored will
  change the rawdata and that is not desired here, so switch to the
  correct data accessor.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9445

AFFECTED FILES
  mercurial/wireprotov2server.py

CHANGE DETAILS




To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
Pierre-Yves David - Dec. 7, 2020, 8:30 p.m.
I think this will behave badly if any other processing flag is involved 
(something like `lfs`, which thankfully is not used on changelog 
revision). What happens to the associated flags ? where they preserved 
by wireprotov2 in the first place ?

On 11/28/20 3:05 PM, joerg.sonnenberger (Joerg Sonnenberger) wrote:
> joerg.sonnenberger created this revision.
> Herald added a reviewer: hg-reviewers.
> Herald added a subscriber: mercurial-patches.
> 
> REVISION SUMMARY
>    When no sidedata is present, rawdata() and revision() are the same. But
>    as soon as sidedata is present, the way it is currently stored will
>    change the rawdata and that is not desired here, so switch to the
>    correct data accessor.
> 
> REPOSITORY
>    rHG Mercurial
> 
> BRANCH
>    default
> 
> REVISION DETAIL
>    https://phab.mercurial-scm.org/D9445
> 
> AFFECTED FILES
>    mercurial/wireprotov2server.py
> 
> CHANGE DETAILS
> 
> diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py
> --- a/mercurial/wireprotov2server.py
> +++ b/mercurial/wireprotov2server.py
> @@ -1046,7 +1046,7 @@
>           followingdata = []
>   
>           if b'revision' in fields:
> -            revisiondata = cl.rawdata(node)
> +            revisiondata = cl.revision(node)
>               followingmeta.append((b'revision', len(revisiondata)))
>               followingdata.append(revisiondata)
>   
> 
> 
> 
> To: joerg.sonnenberger, #hg-reviewers
> Cc: mercurial-patches, mercurial-devel
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
phabricator - Dec. 7, 2020, 8:52 p.m.
joerg.sonnenberger added a comment.


  I don't think they are. The main motivation for pushing this one is to ensure that later changes to result in more sidedata doesn't create spurious failures with wireproto v2. As discussed on IRC around the sprint, it is dead at this point, but I'd still want to avoid introducing extra breakage.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D9445/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D9445

To: joerg.sonnenberger, #hg-reviewers, Alphare, pulkit
Cc: marmoute, mercurial-devel, mercurial-patches

Patch

diff --git a/mercurial/wireprotov2server.py b/mercurial/wireprotov2server.py
--- a/mercurial/wireprotov2server.py
+++ b/mercurial/wireprotov2server.py
@@ -1046,7 +1046,7 @@ 
         followingdata = []
 
         if b'revision' in fields:
-            revisiondata = cl.rawdata(node)
+            revisiondata = cl.revision(node)
             followingmeta.append((b'revision', len(revisiondata)))
             followingdata.append(revisiondata)