Patchwork [minor-cleanup] bundle2: add an informative comment to the capability dict

login
register
mail settings
Submitter Pierre-Yves David
Date May 28, 2015, 5:05 p.m.
Message ID <04ae51b7be17f7bed4ba.1432832737@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/9331/
State Accepted
Headers show

Comments

Pierre-Yves David - May 28, 2015, 5:05 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1432832422 25200
#      Thu May 28 10:00:22 2015 -0700
# Node ID 04ae51b7be17f7bed4ba69872ab51f59adcb43d8
# Parent  bcb17d7dbec25088eaec5e4d34dedbd7057c5d68
bundle2: add an informative comment to the capability dict

It is fairly easy to get confused by capabilities "missing" from this dict. We
make it clear the dict is not the whole story.
Augie Fackler - May 28, 2015, 6:46 p.m.
On Thu, May 28, 2015 at 10:05:37AM -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1432832422 25200
> #      Thu May 28 10:00:22 2015 -0700
> # Node ID 04ae51b7be17f7bed4ba69872ab51f59adcb43d8
> # Parent  bcb17d7dbec25088eaec5e4d34dedbd7057c5d68
> bundle2: add an informative comment to the capability dict

Queued, thanks. Also thanks for marking an easy to review one so I
could just clear it out quickly.

>
> It is fairly easy to get confused by capabilities "missing" from this dict. We
> make it clear the dict is not the whole story.
>
> diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
> --- a/mercurial/bundle2.py
> +++ b/mercurial/bundle2.py
> @@ -1013,10 +1013,12 @@ class unbundlepart(unpackermixin):
>              adjust = self.read(internaloffset)
>              if len(adjust) != internaloffset:
>                  raise util.Abort(_('Seek failed\n'))
>              self._pos = newpos
>
> +# These are only the static capabilities.
> +# Check the 'getrepocaps' function for the rest.
>  capabilities = {'HG20': (),
>                  'listkeys': (),
>                  'pushkey': (),
>                  'digests': tuple(sorted(util.DIGESTS.keys())),
>                  'remote-changegroup': ('http', 'https'),
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -1013,10 +1013,12 @@  class unbundlepart(unpackermixin):
             adjust = self.read(internaloffset)
             if len(adjust) != internaloffset:
                 raise util.Abort(_('Seek failed\n'))
             self._pos = newpos
 
+# These are only the static capabilities.
+# Check the 'getrepocaps' function for the rest.
 capabilities = {'HG20': (),
                 'listkeys': (),
                 'pushkey': (),
                 'digests': tuple(sorted(util.DIGESTS.keys())),
                 'remote-changegroup': ('http', 'https'),