Re: [PATCH 1 of 2] revset: make wdir() work with parent '^' operator(issue4905)

2017-02-24 Thread Pulkit Goyal
>
>
> I have some ugly hacks. Let's talk about them at the sprint if you're
> interested in!
>

​Yeah, sure!​
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2] revset: make wdir() work with parent '^' operator(issue4905)

2017-02-24 Thread Yuya Nishihara
On Fri, 24 Feb 2017 20:23:44 +0530, Pulkit Goyal wrote:
> > Instead, I'm thinking of adding WdirRevIsNotSupportedByUnderlyingStorage
> > exception. It will be raised by revlog if wdir revision is passed, for
> > example,
> > and be caught where we know workingctx and fall back to slow ctx-lookup
> > path.
> >
> 
> ​Okay I will work in this direction to fix this.​

I have some ugly hacks. Let's talk about them at the sprint if you're
interested in!
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2] revset: make wdir() work with parent '^' operator(issue4905)

2017-02-24 Thread Pulkit Goyal
>
>
> IMHO, we shouldn't add this kind of branch to every place where wdir()
> could
> be passed. That would be error-prone and could hurt performance of
> non-wdir()
> cases.
>
​​
​I agree.​


> Instead, I'm thinking of adding WdirRevIsNotSupportedByUnderlyingStorage
> exception. It will be raised by revlog if wdir revision is passed, for
> example,
> and be caught where we know workingctx and fall back to slow ctx-lookup
> path.
>

​Okay I will work in this direction to fix this.​
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2] revset: make wdir() work with parent '^' operator(issue4905)

2017-02-23 Thread Yuya Nishihara
On Thu, 23 Feb 2017 17:30:01 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pul...@gmail.com>
> # Date 1487801796 -19800
> #  Thu Feb 23 03:46:36 2017 +0530
> # Node ID e86b701628b33640c537e7377bbee8b69f22e390
> # Parent  4572027bbe6795e66758120375f647c1c1804195
> revset: make wdir() work with parent '^' operator(issue4905)
> 
> Before this patch, running `hg log -r 'wdir()^'` returns error.
> 
> diff -r 4572027bbe67 -r e86b701628b3 mercurial/revset.py
> --- a/mercurial/revset.py Wed Feb 22 18:33:00 2017 +0530
> +++ b/mercurial/revset.py Thu Feb 23 03:46:36 2017 +0530
> @@ -1399,7 +1399,10 @@
>  ps = set()
>  cl = repo.changelog
>  for r in getset(repo, fullreposet(repo), x):
> -ps.add(cl.parentrevs(r)[0])
> +if r == node.wdirrev:
> +ps.add(subset.last())
> +else:
> +ps.add(cl.parentrevs(r)[0])

IMHO, we shouldn't add this kind of branch to every place where wdir() could
be passed. That would be error-prone and could hurt performance of non-wdir()
cases.

Instead, I'm thinking of adding WdirRevIsNotSupportedByUnderlyingStorage
exception. It will be raised by revlog if wdir revision is passed, for example,
and be caught where we know workingctx and fall back to slow ctx-lookup path.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel