Questions tagged [mercurial-revsets]

Mercurial-revsets is a domain-specific language that allows users to specify custom sets of changesets

The language supports a number of predicates which are joined by infix operators. Parenthesis can be used for grouping.

17 questions
20
votes
3 answers

What is the git equivalent of Mercurial revsets?

Mercurial has a domain-specific language called revsets that allows users to specify sets of revisions. For example, you might want to list patches that haven't yet been merged into the branch default: hg log -r "all() - ancestors('default')" As a…
davidg
  • 5,868
  • 2
  • 33
  • 51
8
votes
2 answers

How do I make a revset alias for tags whose names follow a pattern?

In my repository, I have tags of the form version-1.2.3. I would like to make a revset alias new() that is called like this: hg log -r 'new(1.2.3, 1.2.4)' ...and expands to this: hg log -r '::version-1.2.4 - ::version-1.2.3' # What's new in…
Kevin
  • 28,963
  • 9
  • 62
  • 81
4
votes
1 answer

What is the difference of : and :: and % of mercurial revsets operators

The revsets help mentions "x::y" A DAG range, meaning all changesets that are descendants of x and ancestors of y, including x and y themselves. If the first endpoint is left out, this is equivalent to "ancestors(y)", if the second is left…
sato
  • 101
  • 3
3
votes
1 answer

Mercurial: determine latest tag on each merged branch

To determine which tags have been merged into a given revision, I use a command like this: $ hg log --style=xml -r "ancestors(471694254d60) and tag()" | grep…
2
votes
1 answer

mercurial (hg) equivalent of git describe --contains to find tag that has as an ancestor in its history

I'm trying to use mercurial to give me the tag that contains a specific commit, just like git describe --contains, as described in documentation: --contains Instead of finding the tag that predates the commit, find the tag that comes after the…
Yann Droneaud
  • 5,277
  • 1
  • 23
  • 39
2
votes
1 answer

Is there a Mercurial revset for "working directory"?

I'm trying to script hg diff and want to accept an argument that will be passed to the -r option, and if no argument is given, to default to the working directory. However, it appears there is no value that can be passed to -r to indicate "working…
John Freeman
  • 2,552
  • 1
  • 27
  • 34
2
votes
1 answer

Hg + Eclipse - filtering changesets for transplant

The action I'm repeating over and over is transplanting my changes from default to production branch. However, each time this means a tedious and error prone task of hand picking the changesets I want to transplant between plethora of other…
vartec
  • 131,205
  • 36
  • 218
  • 244
1
vote
1 answer

Why different results of revsets received?

Revset 1 hg log -r "first(sort(date('Nov 2022'),date))" Result changeset: 2180:f6cfbc5fcd0c ... date: Wed Nov 02 09:47:13 2022 +0100 Revset 2 The same (seems so) logic, less code hg log -r "first(date('Nov 2022'))" Result changeset: …
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
1
vote
1 answer

Generating merge logs with mercurial

We're using Mercurial for source control and would like to introduce automatic merging and changelog for our QA process. For the purpose of this discussion, let's just assume that we use a simple 3-branch flow like the below: \ = forward merge | =…
JJJ
  • 509
  • 1
  • 6
  • 14
1
vote
0 answers

How to filter `file_dels` to match glob?

Here's my shell command: hg log --rev 'max(removes('\''**/all_the_things.js'\''))' --template '\{"files":[{join(file_dels % '\''{file|json}'\'','\'','\'')}],"node":{p1node|json}}' This spits out something like this (formatted for legibility): { …
mpen
  • 272,448
  • 266
  • 850
  • 1,236
1
vote
2 answers

Filter by branch creator using tortoisehg

Is it possible to filter by branch creator using tortoisehg? The filter by author option does not shown commits by others to a branch I have created. Ideally I would like a filter that shows all commits to only the branches that I have created.…
user1069620
1
vote
1 answer

Revset filter to show merges / splits of named branches

I want to filter commits in TortoiseHg in such a way that only commits are shown that: Have at least one parent commit in a different named branch; or Have at least one child commit in different named branch; or Are the original starting point…
Jeroen
  • 60,696
  • 40
  • 206
  • 339
1
vote
2 answers

Mercurial revset selecting up to a bookmark

If I have this changesets in my repository A --> B --> C --> D * B is bookmarked and D is at the tip - how do I create a revset that will select everything between B and D but not B. Specifically I'm trying to squash C and D in to B,…
Rafael Munitić
  • 897
  • 2
  • 9
  • 21
0
votes
1 answer

Mercurial - files modified in current branch

Can you help me to create a proper revset for mercurial hg status ? I would like to list all the files that were changed in the current branch since it was created. I tried hg status --rev "branch(foo)" where foo is the name of my branch, but this…
Luk
  • 2,186
  • 2
  • 11
  • 32
0
votes
2 answers

How to limit to N newest entries with Hg Log when specifying a Revset?

This question is not a duplicate of hg log - How to get the last 5 log entries? - it is easy to apply a limit. The problem is that the log output, when limited, does not appear to always be ordered descending by log date - the behavior changes with…
user2864740
  • 60,010
  • 15
  • 145
  • 220
1
2