D5495: revset: add "branch" positional arguments to the merge revset

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Thu Jan 10 08:16:19 EST 2019


yuja added a comment.


  >   I think it would be a good idea to make the "branch" arguments more flexible. One option could be to use a stringmatcher to add support for regular expressions as you suggest. I can look into that. However there may be some other options worth exploring. The one you suggest is very interesting although I find the syntax a bit complicated for the common use cases that I want to enable which are:
  >   
  >   1. Ignore merges from the same branch, which in a named-branch based branching strategy are usually irrelevant
  >   2. Look into merges with a specific branch (e.g. which branches have been merged with the default branch)?
  >   
  >   In my experience those two are the ones that are the most common and I think we should try to make the easy to use. That is, I think that even if mercurial had a filter function like the one you propose I would still want to be able to express those 2 common merge properties in a simple way.
  
  Yep, I agree with that.
  
  >   That being said, I really like your idea since I often find myself being unable to express what I want with a revset (as powerful as those are) because of the lack of a filtering mechanism. Adding a generic filter function would be very useful indeed. I'm not sure if the syntax you propose would work as is though. It seems that it would need a new "&" operator? In any case I believe that it is out of the scope of this particular set of patches. Do you agree?
  
  Yes. Actually I have a PoC-level implementation of generic filtering predicate,
  which can be reviewed separately.
  
  > If so I can focus on improving this patch by adding the stringmatcher as you suggest (as it seems I'm not the only one who thinks this would be useful). Is that ok?
  
  Sounds good to me. To be clear, I want `'withbranch'` instead of
  `'*withbranch'`, because the withbranch option doesn't look like a first-class
  parameter of the `merge()` predicate.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5495

To: angel.ezquerra, #hg-reviewers
Cc: pulkit, yuja, mercurial-devel


More information about the Mercurial-devel mailing list