Yeah
On Tue, Jul 3, 2018 at 11:39 PM durin42 (Augie Fackler) <
phabrica...@mercurial-scm.org> wrote:
> durin42 added a comment.
>
>
> It looks like this is obsoleted by https://phab.mercurial-scm.org/D3826?
>
> REPOSITORY
> rHG Mercurial
>
> REVISION DETAIL
>
durin42 added a comment.
It looks like this is obsoleted by https://phab.mercurial-scm.org/D3826?
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2938
To: sangeet259, #hg-reviewers
Cc: durin42, martinvonz, av6, yuja, pulkit, mercurial-devel
> @yuja I am adding an --unmodified flag to change to change the mode to
> grep on the unmodified files as well.
> What I am trying to do is ::
>
> def fns_generator():
> if --unmodified:
> for f in ctx:
> for f in ctx:
> if
yuja added a comment.
> @yuja I am adding an --unmodified flag to change to change the mode to
grep on the unmodified files as well.
> What I am trying to do is ::
>
> def fns_generator():
> if --unmodified:
> for f in ctx:
> for f
sangeet259 added a comment.
@martinvonz, thanks for the reviews, but @yuja has asked me to break this
patch into three patches. So I guess this is not going to be merged anyway.
Currently, I am trying to add a flag like `--all_files` or `--unmodified`
which will enable one to grep all
martinvonz added inline comments.
INLINE COMMENTS
> sangeet259 wrote in commands.py:2584
> I could have made the call by simply passing `''` instead of
> `opts.get('rev')` but I chose this because I am planning to build upon this
> to handle revisions as well.
I agree with Pulkit: it's
sangeet259 added a comment.
@yuja I am adding an --unmodified flag to change to change the mode to grep
on the unmodified files as well.
What I am trying to do is ::
def fns_generator():
if --unmodified:
for f in ctx:
for f in ctx:
yuja added a comment.
> Hey @yuja
> Can you explain why you did this ?
>
> > - slowpath = match.anypats() or (not match.always() and
opts.get('removed')) +slowpath = True
From my vague memory, I guess I would think that if we do `s/ctx.files()/ctx/`
(which means
> Hey @yuja
> Can you explain why you did this ?
>
> > - slowpath = match.anypats() or (not match.always() and
> opts.get('removed')) +slowpath = True
From my vague memory, I guess I would think that if we do `s/ctx.files()/ctx/`
(which means we're looking for revisions where files
sangeet259 added a comment.
Hey @yuja
Can you explain why you did this ?
> - slowpath = match.anypats() or (not match.always() and
opts.get('removed')) +slowpath = True
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2938
To: sangeet259,
sangeet259 added a comment.
> Perhaps, we'll have to catch WdirUnsupported error to fall back to the
filectx API.
This seems a good idea.
Trying it.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2938
To: sangeet259, #hg-reviewers
Cc: av6, yuja, pulkit,
yuja added a comment.
> So I was working on it, but the way I tried to correct "wdir()" is by
handling it as a special case, so introducing an "if" block again similar to
this.
> But you were asking to eliminate the if/else block altogether, I wonder
if there is way ?
IIRC, my
> So I was working on it, but the way I tried to correct "wdir()" is by
> handling it as a special case, so introducing an "if" block again similar to
> this.
> But you were asking to eliminate the if/else block altogether, I wonder if
> there is way ?
IIRC, my point was to avoid adding
sangeet259 added a comment.
@yuja
So I was working on it, but the way I tried to correct "wdir()" is by
handling it as a special case, so introducing an "if" block again similar to
this.
But you were asking to eliminate the if/else block altogether, I wonder if
there is way ?
yuja added a comment.
> What exactly do you mean by fixing 'grep -r wdir()' ?
Make it return the same result as
$ hg ci -m 'this was wdir()'
$ hg grep -r .
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2938
To: sangeet259, #hg-reviewers
Cc:
sangeet259 marked 2 inline comments as done.
sangeet259 added a comment.
@yuja
> fix grep -r 'wdir()'
What exactly do you mean by fixing 'grep -r wdir()' ?
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2938
To: sangeet259, #hg-reviewers
Cc: av6,
sangeet259 updated this revision to Diff 7289.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D2938?vs=7280=7289
REVISION DETAIL
https://phab.mercurial-scm.org/D2938
AFFECTED FILES
mercurial/commands.py
tests/test-grep.t
CHANGE DETAILS
diff --git
yuja added inline comments.
INLINE COMMENTS
> yuja wrote in commands.py:2474
> > Shall I change that to returning wdirid?
>
> That isn't easy to answer because `wctx.filenode()` can return
> another pseudo
> hash (e.g. 000added) if `wctx._manifest` is preloaded.
>
> > highlight the
yuja added a comment.
In https://phab.mercurial-scm.org/D2938#47514, @sangeet259 wrote:
> @yuja Can you please clarify this a bit more?
>
> > Perhaps we can start with adding an experimental option to grep files
> > including unchanged ones?"
This patch appears to do 3
sangeet259 added a comment.
@yuja Can you please clarify this a bit more?
> Perhaps we can start with adding an experimental option to grep files
> including unchanged ones?"
INLINE COMMENTS
> yuja wrote in commands.py:2474
> Better to test if ctx is a workingctx (i.e. `ctx.rev() is
sangeet259 updated this revision to Diff 7280.
sangeet259 marked 7 inline comments as done.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D2938?vs=7267=7280
REVISION DETAIL
https://phab.mercurial-scm.org/D2938
AFFECTED FILES
mercurial/commands.py
av6 added inline comments.
INLINE COMMENTS
> commands.py:2485
> +fm.data(node=fm.hexfunc(scmutil.binnode(ctx)))
> +if not bool(opts.get('all')) and not bool(opts.get('rev')):
> +cols = [
This line looks identical to the one later on, with Pulkit's comment
yuja added inline comments.
INLINE COMMENTS
> commands.py:2474
> +return util.binary(flog.read(ctx.filenode(fn)))
> +except AttributeError:
> +return util.binary(ctx.filectx(fn).data())
Better to test if ctx is a workingctx (i.e. `ctx.rev() is None`).
yuja added a comment.
Perhaps we can start with adding an experimental option to grep files
including unchanged ones?
IIUC, the new default behavior is something like `hg grep -r "wdir()"
--all-files`,
which is basically `s/ctx.files()/ctx/`.
(needless to say `--all-files` is a bad
sangeet259 updated this revision to Diff 7267.
sangeet259 edited the summary of this revision.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D2938?vs=7266=7267
REVISION DETAIL
https://phab.mercurial-scm.org/D2938
AFFECTED FILES
mercurial/commands.py
pulkit added a comment.
No need to add Edit1, Edit2 in commit message. If something changes from one
version to another that deserves mention, include that in commit message as
normal.
INLINE COMMENTS
> commands.py:2583
> +# when nothing is passed in -r or --all
> +if not
sangeet259 updated this revision to Diff 7266.
sangeet259 edited the summary of this revision.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D2938?vs=7262=7266
REVISION DETAIL
https://phab.mercurial-scm.org/D2938
AFFECTED FILES
mercurial/commands.py
sangeet259 updated this revision to Diff 7262.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D2938?vs=7261=7262
REVISION DETAIL
https://phab.mercurial-scm.org/D2938
AFFECTED FILES
mercurial/commands.py
tests/test-grep.t
CHANGE DETAILS
diff --git
sangeet259 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
The earlier behaviour of grep was quite counter intuitive as it searches
history by default. It throws up matches from files which have been
deleted and
29 matches
Mail list logo