HTTP server: You can use hg serve to start a built-in webserver in Mercurial. Make sure that everybody uses version 2.0 or later with such a setup! There has been bugs in earlier versions of Mercurial that could cause repository corruption when pushing to a repository on a network drive. They commit there as well and finally use hg push to send their changes back to the repository on the shared drive. People make a clone from the drive back to their own machine and work on the files there. You put the repository on the shared drive where everybody can read and write. You have three options:įilesystem access: This is the easiest if you already have a shared network drive setup. Great! To share the project with your colleguages you need to make the repository accessible to them somehow. This also changes the parent changeset of theĪnd if you want to quickly look up something, you can use one of the Mercurial cheatsheets.Ĭompiled from a great email by Martin Geisler.I see in the comments that you managed to get your source files under version control with: $ hg init "hg update" updates the working copy to reflect a given node in "hg push" and "hg pull" transfer nodes in the graph between two It helped my understanding a lot to think in terms of the changeset graph. "impolite" to leave the job of merging to someone else - he whoĬreated the two heads by pulling in some code should also normally If you do not merge C3 and C3' and try to push, you get the 'new Note that the merge changeset M has two parents. To the world how you think the two heads should be combined: Merge must be committed and this creates a changeset which explains Usually trivial, otherwise you have to do a three-way merge. When merging with 'hg merge' the task is to figure out the canonical The changes from one will never be combined with the changed made in Having two heads suggest that someone should merge them - otherwise.The changeset C3' will be the new tip since it is the newestĬhangeset in the repository. Here C1 has two child changesets, and the repository has two heads Is all there is to push/pull: compare two graphs of changesets andĪfter a pull from you my repository will look like this: By default, all missing changesets are transferred. If I pull from you, or you push to me, the two repositories areĬompared.Here C3' is a head in your repository and I don't know anything If I shared C1 with you and you started your work from that, yourĬommits will build a repository like this: It is also the newest changeset in the repository - called "tip". The commit C3 with no children is a "head". If I work alone and make commits I'll make Mercurial generalizes this by letting each changeset have multipleĬhildren. This is simple, but it requires a central server to make sure thatĮverybody agrees on the revision numbers. Gives nice linear revision numbers to them. Subversion requires a strict linear ordering of the commits and Like in Subversion, history consists of a number of commits. Now we'll look at some of the basic concepts of Mercurial to get a better understanding of its internals: Part 2: Understanding Mercurial in 6 steps I you want more than this quick overview, please have a look at our longer practical guide. One step you'll likely want to do is setting your username in your Mercurial config file.įor this you can configure a proper name and email address in ~/.hgrc (or on a Windows system in %USERPROFILE%Mercurial.ini) by adding lines such as the following: (you can also do a lot of finegrained stuff by using different command options. This also helps getting a feeling for what the commands do. If you want to see a nice graph of the history, just do hg serve in your repository and then direct your browser to hg merge: join different lines of history.People can see the history there and pull from it hg serve: create an instant-webserver.hg push: get all changes from your repository into another one.hg pull: get all changes from another repository into the current one.hg log: see all changes in your repository.hg commit: save your changes in the current repository.Stored in the ".hg" directory inside the top-level folder of your project. Not necessarily linear (part 2 explains that model in a bit more detail). Use, once you see the model behind them: Each repository has the whole history, and history is Part 0: Instant usageĬlone a project and create a patch $ hg clone Ĭreate a project and commit $ hg init (project-directory)Īside from the practical Quick Start above, there are only a few commands you need to startĮven if you stick to these basics, Mercurial is quite powerful.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |