README
99 lines
| 2.8 KiB
| text/plain
|
TextLexer
mpm@selenic.com
|
r445 | MERCURIAL QUICK-START | ||
mpm@selenic.com
|
r204 | Setting up Mercurial: | ||
mpm@selenic.com
|
r0 | |||
mpm@selenic.com
|
r204 | Note: some distributions fails to include bits of distutils by | ||
mpm@selenic.com
|
r205 | default, you'll need python-dev to install. You'll also need a C | ||
compiler and a 3-way merge tool like merge, tkdiff, or kdiff3. | ||||
mpm@selenic.com
|
r204 | |||
First, unpack the source: | ||||
mpm@selenic.com
|
r0 | |||
$ tar xvzf mercurial-<ver>.tar.gz | ||||
$ cd mercurial-<ver> | ||||
mpm@selenic.com
|
r204 | |||
Vadim Gelfer
|
r2208 | When installing, change python to python2.3 or python2.4 if 2.2 is the | ||
default on your system. | ||||
mpm@selenic.com
|
r205 | To install system-wide: | ||
mpm@selenic.com
|
r204 | |||
Vadim Gelfer
|
r2208 | $ python setup.py install --force | ||
mpm@selenic.com
|
r204 | |||
mpm@selenic.com
|
r205 | To install in your home directory (~/bin and ~/lib, actually), run: | ||
mpm@selenic.com
|
r204 | |||
Vadim Gelfer
|
r2208 | $ python setup.py install --home=${HOME} --force | ||
mpm@selenic.com
|
r507 | $ export PYTHONPATH=${HOME}/lib/python # (or lib64/ on some systems) | ||
$ export PATH=${HOME}/bin:$PATH # add these to your .bashrc | ||||
mpm@selenic.com
|
r205 | |||
mpm@selenic.com
|
r204 | And finally: | ||
Matt Mackall
|
r3847 | $ hg debuginstall # run some basic tests | ||
$ hg # show help | ||||
mpm@selenic.com
|
r0 | |||
If you get complaints about missing modules, you probably haven't set | ||||
PYTHONPATH correctly. | ||||
Setting up a Mercurial project: | ||||
Vadim Gelfer
|
r2208 | $ hg init project # creates project directory | ||
$ cd project | ||||
# copy files in, edit them | ||||
$ hg add # add all unknown files | ||||
$ hg commit # commit all changes, edit changelog entry | ||||
mpm@selenic.com
|
r0 | |||
Mercurial will look for a file named .hgignore in the root of your | ||||
Matt Mackall
|
r633 | repository which contains a set of regular expressions to ignore in | ||
file paths. | ||||
mpm@selenic.com
|
r0 | |||
Branching and merging: | ||||
Matt Mackall
|
r3507 | $ hg clone project project-work # create a new branch | ||
$ cd project-work | ||||
mpm@selenic.com
|
r0 | $ <make changes> | ||
$ hg commit | ||||
Matt Mackall
|
r3507 | $ cd ../project | ||
$ hg pull ../project-work # pull changesets from project-work | ||||
$ hg merge # merge the new tip from project-work into | ||||
mpm@selenic.com
|
r261 | # our working directory | ||
Matt Mackall
|
r633 | $ hg commit # commit the result of the merge | ||
mpm@selenic.com
|
r0 | |||
Importing patches: | ||||
Matt Mackall
|
r3507 | Simple: | ||
mpm@selenic.com
|
r0 | $ patch < ../p/foo.patch | ||
Vadim Gelfer
|
r2208 | $ hg commit -A | ||
mpm@selenic.com
|
r0 | |||
Matt Mackall
|
r3507 | Fast: | ||
Thomas Arendsen Hein
|
r1308 | $ cat ../p/patchlist | xargs hg import -p1 -b ../p | ||
mpm@selenic.com
|
r0 | |||
mpm@selenic.com
|
r205 | Exporting a patch: | ||
(make changes) | ||||
$ hg commit | ||||
Matt Mackall
|
r3507 | $ hg export tip > foo.patch # export latest change | ||
mpm@selenic.com
|
r205 | |||
mpm@selenic.com
|
r63 | Network support: | ||
mpm@selenic.com
|
r445 | # pull from the primary Mercurial repo | ||
Thomas Arendsen Hein
|
r1308 | foo$ hg clone http://selenic.com/hg/ | ||
Matt Mackall
|
r633 | foo$ cd hg | ||
mpm@selenic.com
|
r1 | |||
Thomas Arendsen Hein
|
r3689 | # make your current repo available via http://server:8000/ | ||
foo$ hg serve | ||||
Thomas Arendsen Hein
|
r1308 | |||
Thomas Arendsen Hein
|
r3689 | # pushing and pulling changes to/from a remote repo with SSH | ||
foo$ hg push ssh://user@example.com/my/repository | ||||
foo$ hg pull ssh://user@example.com//home/somebody/his/repository | ||||
mpm@selenic.com
|
r327 | |||
Thomas Arendsen Hein
|
r3689 | # merge changes from a remote machine (e.g. running 'hg serve') | ||
bar$ hg pull http://foo:8000/ | ||||
Vadim Gelfer
|
r2208 | bar$ hg merge # merge changes into your working directory | ||
Thomas Arendsen Hein
|
r3689 | bar$ hg commit # commit merge in to your local repository | ||
mpm@selenic.com
|
r63 | |||
mpm@selenic.com
|
r160 | # Set up a CGI server on your webserver | ||
mpm@selenic.com
|
r445 | foo$ cp hgweb.cgi ~/public_html/hg/index.cgi | ||
foo$ emacs ~/public_html/hg/index.cgi # adjust the defaults | ||||
mpm@selenic.com
|
r969 | |||
For more info: | ||||
Documentation in doc/ | ||||
Mercurial website at http://selenic.com/mercurial | ||||