So in Subversion when I do an svn up
I get a list of files that were added, modified, deleted, and conflicted.
When I do an hg pull
then hg up -v
it just displays a list of: getting file.ext
but I have no way of know if that file is new or already existed. Is there a way to have Mercurial display the same sort of meta about if the file was added, modified, or deleted?
Does Mercurial offer any ability to do what I am asking?
Omni has your answer, and I voted for it, but just to show all the options:
Before pulling
After pulling (but not updating):
Use the status command to list changes in file status between the working copy and its parent revision or between any two revisions. It gives you output like this:
$ hg status --rev .:tip
M hgext/keyword.py
M mercurial/cmdutil.py
M mercurial/commands.py
M mercurial/context.py
M mercurial/patch.py
A tests/test-encoding-align
A tests/test-encoding-align.out
which corresponds to this update:
$ hg update -v
resolving manifests
getting hgext/keyword.py
getting mercurial/cmdutil.py
getting mercurial/commands.py
getting mercurial/context.py
getting mercurial/patch.py
getting tests/test-encoding-align
getting tests/test-encoding-align.out
7 files updated, 0 files merged, 0 files removed, 0 files unresolved
Edit: You can create a preupdate
hook to always get this information as part of your updates. I happen to be on Windows right now, and here this hook works:
[hooks]
preupdate = hg status --rev .:%HG_PARENT1%
Replace %HG_PARENT1%
with $HG_PARENT1
on Unix-like systems. This should make the Mercurial experience even more Subversion-like :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With