You might also want to keep your changes confidential and prefer internal email (if you want additional protection, you can also encrypt the emails, for example with GnuPG). Often you won't have direct access to the repository of someone else, be it because he's behind a restrictive firewall, or because you live in different timezones. All the data is now in your individual repositories and you can merge the changes and work with them without needing any connection to the served repository. If they decide to include the changes, they just pull from the same URL $ hg pull Īt this point you all can work as if you had pulled from a local repository. They will then see all his history there and can decide if they want to pull his changes. Now all others can point their browsers to his IP address (for example 192.168.178.100) at port 8000. This is the easiest way to quickly share changes.įirst the one who wants to share his changes creates the webserver $ hg serve Instead of using the builtin webserver, you can also send the changes by email or setup a shared repository, to where you push changes instead of pulling them. There are a few other ways to share changes, though. To check if you're really at that revision, you can use identify -n. Now your code is back at revision 1, the second commit (Mercurial starts counting at 0). Let's assume that you want to see revision 1. To look at a previous version of your code, you can use update. $ hg add # tell Mercurial to track all filesĭifferent from the log keeping workflow, you'll want to go back in history at times and do some changes directly there, for example because an earlier change introduced a bug and you want to fix it where it occurred. Init your project, add files, see changes and commit them. To start a new project, you initialize a repository, add your files and commit whenever you finished a part of your work.Īlso you check your history from time to time, so see how you progressed. ![]() It works just like the log keeping workflow, with the difference that you go back to earlier changes at times and work onwards from there. The second workflow is still very easy: You're a lone developer and you want to use Mercurial to keep track of your own changes and optimize your workflow. Lone developer with nonlinear history Use case To also see the diff of the displayed revisions, there's the -p switch (-patch) $ hg log -p -r 3 To see a certain revision, you can use the -r switch (-revision). Summary: Say Hello World, not just Hello. ![]() Now you add a new folder in which you want to work: $ hg init projectĮnter the project folder, create some files, then add and commit them. For that you open the file ~/.hgrc (or mercurial.ini in your home directory for Windows) with a text-editor and add the ui section (user interaction) with your username: Workflow Prepare MercurialĪs first step, you should teach Mercurial your name. It shows the basic techniques for more complex workflows. This workflow only requires an installed Mercurial and write access to some file storage (you almost definitely have that :) ). The first workflow is also the easiest one: You want to use Mercurial to be able to look back when you did which changes. Those further down build on previous workflows. We go from simple to more complex workflows. Basic command line abilities are helpful, because we'll use the command line client. This guide doesn't require any prior knowledge of version control systems (though subversion users will likely feel at home quite quickly).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |