Patchwork store: remove unnecessary copying on requires file

login
register
mail settings
Submitter Pulkit Goyal
Date Sept. 16, 2020, 1:15 p.m.
Message ID <ed13c879d4d46075d76d.1600262115@workspace>
Download mbox | patch
Permalink /patch/47177/
State New
Headers show

Comments

Pulkit Goyal - Sept. 16, 2020, 1:15 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1597134985 -19800
#      Tue Aug 11 14:06:25 2020 +0530
# Node ID ed13c879d4d46075d76d7b4e2d7a5c3995a44e20
# Parent  bd56597b225455b1d34501c043e36e62c1aa4748
# EXP-Topic refactor
store: remove unnecessary copying on requires file

This copying of `requires` file dates back to
0642d9d7ec80a307e0c0bb7fa9c696155fc146da which is 12 years old.

None of the tests fail with this patch but that might be because we still copy
in fncachestore and that is used everywhere.
Yuya Nishihara - Sept. 17, 2020, 10:39 a.m.
On Wed, 16 Sep 2020 18:45:15 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1597134985 -19800
> #      Tue Aug 11 14:06:25 2020 +0530
> # Node ID ed13c879d4d46075d76d7b4e2d7a5c3995a44e20
> # Parent  bd56597b225455b1d34501c043e36e62c1aa4748
> # EXP-Topic refactor
> store: remove unnecessary copying on requires file
> 
> This copying of `requires` file dates back to
> 0642d9d7ec80a307e0c0bb7fa9c696155fc146da which is 12 years old.

This would break local clone of old repositories. Try
--format.usestore=false.
Pulkit Goyal - Sept. 17, 2020, 12:53 p.m.
On Thu, Sep 17, 2020 at 4:34 PM Yuya Nishihara <yuya@tcha.org> wrote:
>
> On Wed, 16 Sep 2020 18:45:15 +0530, Pulkit Goyal wrote:
> > # HG changeset patch
> > # User Pulkit Goyal <7895pulkit@gmail.com>
> > # Date 1597134985 -19800
> > #      Tue Aug 11 14:06:25 2020 +0530
> > # Node ID ed13c879d4d46075d76d7b4e2d7a5c3995a44e20
> > # Parent  bd56597b225455b1d34501c043e36e62c1aa4748
> > # EXP-Topic refactor
> > store: remove unnecessary copying on requires file
> >
> > This copying of `requires` file dates back to
> > 0642d9d7ec80a307e0c0bb7fa9c696155fc146da which is 12 years old.
>
> This would break local clone of old repositories. Try
> --format.usestore=false.

Oh, I see. Thank you!

Patch

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -455,7 +455,7 @@  class basicstore(object):
             yield x
 
     def copylist(self):
-        return [b'requires'] + _data
+        return _data
 
     def write(self, tr):
         pass
@@ -502,7 +502,7 @@  class encodedstore(basicstore):
         return self.path + b'/' + encodefilename(f)
 
     def copylist(self):
-        return [b'requires', b'00changelog.i'] + [b'store/' + f for f in _data]
+        return [b'00changelog.i'] + [b'store/' + f for f in _data]
 
 
 class fncache(object):