How can I get the change set ID of the base file when merging with mercurial?

I have several branches that I need to merge, but I do not know where some of the changes that appear in my merge tool come from. The change sets of local and other are obvious, but how can I find out from which changes the base file was installed? I work in a repository with dozens of branches, so viewing the chart and tracking its work is not very good.

+3
source share
2 answers

Using revsets (Mercurial 1.6 and later), you can get the common ancestor of two sets of changes with:

hg log -r ancestor(rev1,rev2)
+4
source

hg grep:

hg grep [OPTION]... PATTERN [FILE]...

search for a pattern in specified files and revisions

    Search revisions of files for a regular expression.

    This command behaves differently than Unix grep. It only accepts
    Python/Perl regexps. It searches repository history, not the working
    directory. It always prints the revision number in which a match appears.

    By default, grep only prints output for the first revision of a file in
    which it finds a match. To get it to print every revision that contains a
    change in match status ("-" for a match that becomes a non-match, or "+"
    for a non-match that becomes a match), use the --all flag.

    Returns 0 if a match is found, 1 otherwise.

options:

 -0 --print0               end fields with NUL
    --all                  print all revisions that match
 -f --follow               follow changeset history, or file history across
                           copies and renames
 -i --ignore-case          ignore case when matching
 -l --files-with-matches   print only filenames and revisions that match
 -n --line-number          print matching line numbers
 -r --rev REV [+]          only search files changed within revision range
 -u --user                 list the author (long with -v)
 -d --date                 list the date (short with -q)
 -I --include PATTERN [+]  include names matching the given patterns
 -X --exclude PATTERN [+]  exclude names matching the given patterns
    --mq                   operate on patch repository

[+] marked option can be specified multiple times

use "hg -v help grep" to show global options

:

hg grep "a string"

, .

- , hg log -v, , hg log -p, .

+1

Source: https://habr.com/ru/post/1786966/


All Articles