Firefoxtree should serve tags during a local pull

RESOLVED FIXED

Status

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: botond, Assigned: gps)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
STR:
  1. Pull from firefox-unified into a local repo 'local1'.
  2. In 'local1', set [firefoxtree] servetags = True.
  3. Pull from 'local1' into another local repo 'local2'.

Expected results:
  "hg fxheads" in 'local2' shows inbound, central, etc.

Actual results:
  "hg fxheads" in 'local2' does not show all the heads.
  If I instead "hg serve" in 'local1', and 
  "hg pull http://localhost:8000/" in 'local2', it works.
(Assignee)

Updated

2 years ago
Assignee: nobody → gps
Status: NEW → ASSIGNED
(Assignee)

Comment 1

2 years ago
Created attachment 8756708 [details]
MozReview Request: firefoxtree: support pulling firefoxtree labels from local peers (bug 1275663); r=smacleod

Today I learned that "local" peer repository instances in Mercurial
have a separate code path from remote peer repos (namely httppeer
and sshpeer) for retrieving capabilities and calling wire proto
commands.

localrepo.py has a "moderncaps" module level variable holding a set
of capabilities. This is used by localpeer.__init__ to set the
capabilities for localpeer instances. Fortunately,
localrepository._restrictcapabilities is called during
localpeer.__init__, giving us a hook point to adjust the capabilities
set. If you look at the default implementation of that function, it
adds a capability, so the "restrict" part of its name isn't very
accurate.

We implement our own _restrictcapabilities function that supplements
the capabilities set if the repo is a Firefox repo.

But that's not all. Calling commands on localpeers is different because
there is no generic "call" API on localpeer instances. Instead,
methods call functions directly. So, when calling the "firefoxtrees"
wire protocol command, we detect local peers and make a direct
function call.

I wonder how many other extensions in version-control-tools won't work
with localpeer instances because we haven't implemented this pattern
before...

Review commit: https://reviewboard.mozilla.org/r/55342/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/55342/
Attachment #8756708 - Flags: review?(smacleod)
Comment on attachment 8756708 [details]
MozReview Request: firefoxtree: support pulling firefoxtree labels from local peers (bug 1275663); r=smacleod

https://reviewboard.mozilla.org/r/55342/#review52248

::: hgext/firefoxtree/__init__.py:579
(Diff revision 1)
> +            if isfirefoxrepo(self) and \
> +                self.ui.configbool('firefoxtree', 'servetags', False):

```
            if (isfirefoxrepo(self) and
                    self.ui.configbool('firefoxtree', 'servetags', False)):
```
Attachment #8756708 - Flags: review?(smacleod) → review+
(Assignee)

Comment 3

2 years ago
Comment on attachment 8756708 [details]
MozReview Request: firefoxtree: support pulling firefoxtree labels from local peers (bug 1275663); r=smacleod

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/55342/diff/1-2/
Attachment #8756708 - Attachment description: MozReview Request: firefoxtree: support pulling firefoxtree labels from local peers (bug 1275663); r?smacleod → MozReview Request: firefoxtree: support pulling firefoxtree labels from local peers (bug 1275663); r=smacleod
(Assignee)

Comment 4

2 years ago
Autolanded.

https://hg.mozilla.org/hgcustom/version-control-tools/rev/a1f11693beaf
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.