Check what will be done before actual execution

I am learning Mercurial, and although I installed TortoiseHG, I am becoming more and more on the command line.

Therefore, often I would like to check what the result of this command hgwould be before I ran it. Is there any equivalent to a switch -whatifknown from PowerShell that I can use, or how can you check what would be done with a given statement hg commit?

+3
source share
2 answers

When you commit, your message editor will contain a list of files that will be transferred in the ignored section. If you make a transaction with hg -m "message", this will not work when the editor step is skipped:

HG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: Leave message empty to abort commit.
HG: --
HG: user: User <user@user.land>
HG: branch 'default'
HG: changed myfile.yxy

You can use hg commitit hg rollbackto cancel the last commit if it contains a file that you do not want to commit. rollback works until you are hg pushin a different repository.

State works with the same patterns as commit. You can use hg status some/path/*and then hg commit some/path/*replace only the command to use.

+2
source

-n --dry-run , . commit -n, hg diff, , hg status, , .

+2

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


All Articles