![]() ![]() If you have edited a file and want to back out those edits, and if you have not done a commit since those edits were made, you can also use the revert command to restore the file to how it appears in the parent of the working directory. You may only revert changes that have not yet been committed. If you mistakenly add, remove, copy, or rename a file and wish to undo that change, simply use the revert command against the file(s) and it will be as if you had never made the change. If you make a mistake to your repo you can use the revert command to back out those changes. Note that there is no need to specify the location of the fetch extension because this extension is distributed with Hg so that Hg knows where it is located. To enable this extension add these lines to your config file: There is also a standard extension called fetch the does a pull, update, merge, then a commit all in one operation. To review the revisions without actually merging the changes into your repo, use the -P option:Īfter any necessary merging has been completed, the commit command must be used to commit the changes to the repo: ![]() This can be done using the merge command: You will also need to resolve any file conflicts after doing an update. The pull and update steps can be done with one command: Using the Hg update command is analogous to what other source control systems call check-out. To have these changeset(s) applied to your repo you must use the update command: Hg has only updated the repo files with the latest changeset(s) from the source repo. You can then update your repo to this explicit changeset ID with a command like this: The incoming command will tell you the changeset ID of the latest changeset. Since it is possible that changes might have been made to the source repo after you issued the incoming command but before you used the pull command, you might want to explicitly update your repo to a specific rev of the source repo. The tip commands before and after the pull command will tell you the rev of your repo before the pull and after the pull. If you see any changes you want to bring into your copy of the repo use the pull command: To update your local copy of the repo, first take a look at the changes that have been made to the source repo using the incoming command: As changes are made to the repo you copied from you will probably want to update your repo with those changes. So now you have a copy of a repo stored locally. The tip revision is the changeset most recently added to the repository (and therefore the most recently changed head) and the tip tag is special and cannot be renamed or assigned to a different changeset. There is a head changeset for each branch that exists in the repo, and there can be multiple heads with the same branch name. Changesets that don’t have any children are called head changesets, or heads. The commit command creates a new changset, assigns it a rev and ID, and records the parent of the changeset (except in the case of the root changeset). ![]() So when working with a local repo it is easier to type the small numbers used to identify a changeset, while still having a unique ID across all copies of the repo in order to identify a changeset. Changesets are assigned revision numbers, which are unique to a repo but not to other copies of the repo, and an identifier, consisting of 12 hex digits, which is unique across all copies of a repo. The term is often abbreviated to change or cset and is also referred to as a revision or a rev. Every repo is complete and independent from any other repos for the project.A changeset is an identified set of changes made to one or more files in a repo. Hg refers to the set of files that make up a project as a repository, or repo. Mercurial, a/k/a Hg, is a source code management tool. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |