# HG changeset patch # User Pierre-Yves David # Date 1602690388 -7200 # Node ID 80f32ec8653aa06337c21bd144bf57f10b0221d9 # Parent 74271829ddc0d1d6c9a7122dda861e8e5f474952 clonebundle: move the manifest filename to a constant I am about to add more reference to it, so I would rather have it an explicit constant. This allow to unify various call too. Differential Revision: https://phab.mercurial-scm.org/D9209 diff -r 74271829ddc0 -r 80f32ec8653a hgext/clonebundles.py --- a/hgext/clonebundles.py Thu Oct 15 15:57:36 2020 +0200 +++ b/hgext/clonebundles.py Wed Oct 14 17:46:28 2020 +0200 @@ -205,6 +205,7 @@ from __future__ import absolute_import from mercurial import ( + bundlecaches, extensions, wireprotov1server, ) @@ -218,7 +219,7 @@ # Only advertise if a manifest exists. This does add some I/O to requests. # But this should be cheaper than a wasted network round trip due to # missing file. - if repo.vfs.exists(b'clonebundles.manifest'): + if repo.vfs.exists(bundlecaches.CB_MANIFEST_FILE): caps.append(b'clonebundles') return caps diff -r 74271829ddc0 -r 80f32ec8653a mercurial/bundlecaches.py --- a/mercurial/bundlecaches.py Thu Oct 15 15:57:36 2020 +0200 +++ b/mercurial/bundlecaches.py Wed Oct 14 17:46:28 2020 +0200 @@ -16,6 +16,8 @@ urlreq = util.urlreq +CB_MANIFEST_FILE = b'clonebundles.manifest' + @attr.s class bundlespec(object): diff -r 74271829ddc0 -r 80f32ec8653a mercurial/localrepo.py --- a/mercurial/localrepo.py Thu Oct 15 15:57:36 2020 +0200 +++ b/mercurial/localrepo.py Wed Oct 14 17:46:28 2020 +0200 @@ -31,6 +31,7 @@ bookmarks, branchmap, bundle2, + bundlecaches, changegroup, color, commit, @@ -299,7 +300,7 @@ return self._caps def clonebundles(self): - return self._repo.tryread(b'clonebundles.manifest') + return self._repo.tryread(bundlecaches.CB_MANIFEST_FILE) def debugwireargs(self, one, two, three=None, four=None, five=None): """Used to test argument passing over the wire""" diff -r 74271829ddc0 -r 80f32ec8653a mercurial/wireprotov1server.py --- a/mercurial/wireprotov1server.py Thu Oct 15 15:57:36 2020 +0200 +++ b/mercurial/wireprotov1server.py Wed Oct 14 17:46:28 2020 +0200 @@ -273,7 +273,7 @@ data center given the client's IP address. """ return wireprototypes.bytesresponse( - repo.vfs.tryread(b'clonebundles.manifest') + repo.vfs.tryread(bundlecaches.CB_MANIFEST_FILE) )