Hg to see a set of changes before hg

Which mercurial command can you use to view a set of changes before changing xyz?

If you run hg log -r :xyz , you see all changes to (including) xyz - listed in ascending order. But I would like to easily see only the previous set of changes.


Update. Indeed, for me it is: if I do hg fetch , which command can I use to see the PRIOR of changes in the sets of changes that were extracted using the selection?

hg log -r :xyz where xyz is the first set of changes typed by fetch, but it returns the entire list of previous sets of changes where I just need the latest one.

+4
source share
4 answers

You cannot do this. After you pulled (and fetching is just pull + either updating or merging), there is no record of what you had before pushing and what you just got from the pull.

You must do an hg incoming before pulling to see what you get.

Also stop using fetch . Pulling, updating, and merging events are completely separate, and their execution in one command provides an inadequate error message and simply confuses things. The command is disabled by default, and it talks about uninstalling completely. Merging is coding, and it should not be hidden.

Expanding to show cases you cannot cover

If before retrieving your story this is:

 [A]-[B]-[C] 

and you (against all the tips) fetch and get [D] , you now have:

 [A]-[B]-[C]-[D] 

And you can see exactly what's new:

 hg diff -r tip-1 

or using:

 hg diff -r "parent(tip)" 

But if you start again with A, B, C, you will get and get D, E, giving this:

 [A]-[B]-[C]-[D]-[E] 

there is no command that you can run to see “what has changed” without writing [C] to the note earlier.

If, on the other hand, your repo started to look like this:

 [A]-[B] \ -[C] 

and after extracting you will get the following:

 [A]-[B]-[D] \ -[C]-[E] 

there is no single team that tells you "what has changed." Similarly, if before stretching your repo it looked like this:

 [A]-[B]-[C] 

and after receiving you received the following:

 [A]-[B]-[C]-[E]-[F] \ / -[D]-------/ 

where [F] is a new ill-conceived automatic merge change sample, then created by the command:

 hg diff -r C 

will tell you what's new, but there is no way to search for "C" without writing it down earlier.

+7
source

I assume xyz is a collection of changes in the hash form. Try:

hg log -r: xyz-1

This should work to list only a set of changes to 1

0
source

If the parentrevspec extension is installed [1], you can use the git -like syntax below. Depending on your shell, quotation marks may not be needed.

 hg log -r 'xyz^' 
0
source

I am not sure what is implied before. Your question may mean that you may just want a set of parents to change. You can easily get it with

 hg parent -r xyz 

It does not need new Mercurial models.

hg parents [-r REV] [FILE]

show parents a working directory or version

Print the parent revisions of the working directory. If a revision is provided via -r / - rev, the parent of that revision will be printed. If the argument of the file in which the last file was changed (to the version of the working directory or the argument --rev, if specified).

options:

 -r --rev show parents of the specified revision --style display using template map file --template display with template --mq operate on patch repository 
0
source

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


All Articles