Submitter | Siddharth Agarwal |
---|---|
Date | Aug. 30, 2014, 1:02 p.m. |
Message ID | <180c5c9d4a4d9a71ac27.1409403777@devbig136.prn2.facebook.com> |
Download | mbox | patch |
Permalink | /patch/5635/ |
State | Accepted |
Headers | show |
Comments
On Sat, 2014-08-30 at 06:02 -0700, Siddharth Agarwal wrote: > # HG changeset patch > # User Siddharth Agarwal <sid0@fb.com> > # Date 1409401778 25200 > # Sat Aug 30 05:29:38 2014 -0700 > # Node ID 180c5c9d4a4d9a71ac2798e9671adea813c822ed > # Parent bdc0e04df243d3995c7266bf7d138fddd0449ba6 > memctx: allow extensions to determine what filectxfn should do Queued for default, thanks.
On 08/30/2014 03:02 PM, Siddharth Agarwal wrote: > # HG changeset patch > # User Siddharth Agarwal <sid0@fb.com> > # Date 1409401778 25200 > # Sat Aug 30 05:29:38 2014 -0700 > # Node ID 180c5c9d4a4d9a71ac2798e9671adea813c822ed > # Parent bdc0e04df243d3995c7266bf7d138fddd0449ba6 > memctx: allow extensions to determine what filectxfn should do > > Rev 650b5b6e75ed switched the contract for filectxfn from "raise IOError if > file is missing" to "return None if file is missing". Out of tree extensions > need to be updated for that, but for extensions interested in compatibility > with both Mercurial <= 3.1 and default, it is next to impossible to introspect > core Mercurial to figure out what to do. > > This patch adds a field to memctx for extensions to use. > > diff --git a/mercurial/context.py b/mercurial/context.py > --- a/mercurial/context.py > +++ b/mercurial/context.py > @@ -1593,6 +1593,12 @@ > supported by util.parsedate() and defaults to current date, extra > is a dictionary of metadata or is left empty. > """ > + > + # Mercurial <= 3.1 expects the filectxfn to raise IOError for missing files. I guess it would be slightly more precise to say < 3.2 to avoid 3.1.x ambiguity. /Mads > + # Extensions that need to retain compatibility across Mercurial 3.1 can use > + # this field to determine what to do in filectxfn. > + _returnnoneformissingfiles = True > + > def __init__(self, repo, parents, text, files, filectxfn, user=None, > date=None, extra=None, editor=False): > super(memctx, self).__init__(repo, text, user, date, extra) > _______________________________________________ > Mercurial-devel mailing list > Mercurial-devel@selenic.com > http://selenic.com/mailman/listinfo/mercurial-devel
Patch
diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -1593,6 +1593,12 @@ supported by util.parsedate() and defaults to current date, extra is a dictionary of metadata or is left empty. """ + + # Mercurial <= 3.1 expects the filectxfn to raise IOError for missing files. + # Extensions that need to retain compatibility across Mercurial 3.1 can use + # this field to determine what to do in filectxfn. + _returnnoneformissingfiles = True + def __init__(self, repo, parents, text, files, filectxfn, user=None, date=None, extra=None, editor=False): super(memctx, self).__init__(repo, text, user, date, extra)