简体   繁体   中英

How can i check which files and what content have changed in hg pull

I was on default branch.

Then i used hg pull -u

Then i get this

searching for changes
adding changesets
adding manifests
adding file changes
added 3 changesets with 3 changes to 1 files
1 files updated, 0 files merged, 0 files removed, 0 files unresolved

Now i want to know what files were updated and what contents were updated in that filew hich was updated

This is why it's better to use hg pull not hg pull -u . If you used the preferred hg pull Your session would look like this:

$ hg pull
searching for changes
adding changesets
adding manifests
adding file changes
added 3 changesets with 3 changes to 1 files

$ hg diff default  # this shows you exactly what you want to see

$ hg update
1 files updated, 0 files merged, 0 files removed, 0 files unresolved

The key there is that if you pull (the new changesets into your repository) but don't update the files in your working directory you can then hg diff default which compares your current working directory's files (aka what you had before the pull) and the new head of default after the pull. If you like the changes then you apply them to your local files with hg update .

That said, in this specific case since you know you got 3 changesets, and since they're probably linear you can do:

hg diff --rev -4

which says compare my current revision (now the head since you updated) with the revision 3 back (-1 is the last). But break the -u habit. Updating your repository and your working directory are entirely different actions and better done separately.

hg incoming will let you check for new changesets that will be pulled when you do a hg pull (with or without the update option). I typically do this through TortoiseHG and it lets me sanity check what will come in before I actually bring the changes into my local repository let alone update to that changeset.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM