How to get a specific version of a file in Mercurial?
I think you want hg revert -r<rev> <file> (this will change that file to be as it was at the given revision).
I think you want hg revert -r<rev> <file> (this will change that file to be as it was at the given revision).
As suggested by Mark, the MqExtension is one solution for you problem. IMHO a simpler workflow is to use the rebase extension. Suppose you have a history like this: @ changeset: 2:81b92083cb1d | tag: tip | summary: my new feature: edit file a | o changeset: 1:8bdc4508ac7b | summary: my new feature: add file b … Read more
You can even add multiple entries in the [paths] section of your .hg/hgrc file. [paths] default = /repo_store/hg/project1 sandbox = /repo_store/hg/project1_experimental And then can specify its alias in the mercurial commands. default repo need not be specified but others have to be like, hg in # check incoming changes from default repo hg in default … Read more
One way would be hg rollback (deprecated as of Hg2.7, August 2013) Please use hg commit –amend instead of rollback to correct mistakes in the last commit. Roll back the last transaction in a repository. When committing or merging, Mercurial adds the changeset entry last. Mercurial keeps a transaction log of the name of each … Read more
You can just hg update to the closed branch then do another hg commit and it will automatically reopen. The closed flag is just used to filter out closed branches from hg branches and hg heads unless you use the –closed option – it doesn’t prevent you from using the branches.
Once you have cloned the repo, you have everything: you can then hg up branchname or hg up tagname to update your working copy. UP: hg up is a shortcut of hg update, which also has hg checkout alias for people with git habits.
BTW: if you just revert the merge you did and 3 is not your revision number you can do this: hg update -C -r .
Those steps should be able to be shortened down to: hg pull hg update -r MY_BRANCH -C The -C flag tells the update command to discard all local changes before updating. However, this might still leave untracked files in your repository. It sounds like you want to get rid of those as well, so I … Read more
Update your repository to the head with the revision that you want to forget about, then use hg commit –close-branch to mark that (anonymous) branch as closed. Then update to the head of the branch that you do want, and continue working. You can still see the closed branch if you use the -c option … Read more
Both existing answers suggest storing your username and password unencrypted in plain-text, which is a bit of a no-no. You should use the Keyring extension instead, as it has been specifically designed for securely saving authentication passwords. It already comes bundled with TortoiseHg, so all you have to do is activate it by writing the … Read more