README
author Vadim Gelfer <vadim.gelfer@gmail.com>
Tue, 08 Aug 2006 16:09:26 -0700
changeset 2822 4f7abf341cd4
parent 2208 12e36dedf668
child 3507 72efff4be2ad
permissions -rw-r--r--
fetch: fix breakage from mpm. add test so will not break again.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
445
fe48ffa3665f README tidy-up
mpm@selenic.com
parents: 330
diff changeset
     1
MERCURIAL QUICK-START
fe48ffa3665f README tidy-up
mpm@selenic.com
parents: 330
diff changeset
     2
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
     3
Setting up Mercurial:
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
     4
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
     5
 Note: some distributions fails to include bits of distutils by
205
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
     6
 default, you'll need python-dev to install. You'll also need a C
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
     7
 compiler and a 3-way merge tool like merge, tkdiff, or kdiff3.
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
     8
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
     9
 First, unpack the source:
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    10
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    11
 $ tar xvzf mercurial-<ver>.tar.gz
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    12
 $ cd mercurial-<ver>
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
    13
2208
12e36dedf668 update README.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2031
diff changeset
    14
 When installing, change python to python2.3 or python2.4 if 2.2 is the
12e36dedf668 update README.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2031
diff changeset
    15
 default on your system.
12e36dedf668 update README.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2031
diff changeset
    16
205
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    17
 To install system-wide:
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
    18
2208
12e36dedf668 update README.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2031
diff changeset
    19
 $ python setup.py install --force
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
    20
205
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    21
 To install in your home directory (~/bin and ~/lib, actually), run:
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
    22
2208
12e36dedf668 update README.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2031
diff changeset
    23
 $ python setup.py install --home=${HOME} --force
507
dd8b19114fe7 README: mention lib64/
mpm@selenic.com
parents: 445
diff changeset
    24
 $ export PYTHONPATH=${HOME}/lib/python  # (or lib64/ on some systems)
dd8b19114fe7 README: mention lib64/
mpm@selenic.com
parents: 445
diff changeset
    25
 $ export PATH=${HOME}/bin:$PATH         # add these to your .bashrc
205
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    26
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
    27
 And finally:
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
    28
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    29
 $ hg                                    # test installation, show help
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    30
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    31
 If you get complaints about missing modules, you probably haven't set
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    32
 PYTHONPATH correctly.
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    33
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    34
Setting up a Mercurial project:
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    35
2208
12e36dedf668 update README.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2031
diff changeset
    36
 $ hg init project     # creates project directory
12e36dedf668 update README.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2031
diff changeset
    37
 $ cd project
12e36dedf668 update README.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2031
diff changeset
    38
                       # copy files in, edit them
12e36dedf668 update README.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2031
diff changeset
    39
 $ hg add              # add all unknown files
12e36dedf668 update README.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2031
diff changeset
    40
 $ hg remove --after   # remove deleted files
12e36dedf668 update README.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2031
diff changeset
    41
 $ hg commit           # commit all changes, edit changelog entry
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    42
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    43
 Mercurial will look for a file named .hgignore in the root of your
633
f597539c7abd Slim down and update README a bit
Matt Mackall <mpm@selenic.com>
parents: 631
diff changeset
    44
 repository which contains a set of regular expressions to ignore in
f597539c7abd Slim down and update README a bit
Matt Mackall <mpm@selenic.com>
parents: 631
diff changeset
    45
 file paths.
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    46
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    47
Branching and merging:
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    48
633
f597539c7abd Slim down and update README a bit
Matt Mackall <mpm@selenic.com>
parents: 631
diff changeset
    49
 $ hg clone linux linux-work    # create a new branch
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    50
 $ cd linux-work
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    51
 $ <make changes>
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    52
 $ hg commit
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    53
 $ cd ../linux
261
3dae0296551d Update README
mpm@selenic.com
parents: 241
diff changeset
    54
 $ hg pull ../linux-work     # pull changesets from linux-work
2208
12e36dedf668 update README.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2031
diff changeset
    55
 $ hg merge                  # merge the new tip from linux-work into
261
3dae0296551d Update README
mpm@selenic.com
parents: 241
diff changeset
    56
                             # our working directory
633
f597539c7abd Slim down and update README a bit
Matt Mackall <mpm@selenic.com>
parents: 631
diff changeset
    57
 $ hg commit                 # commit the result of the merge
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    58
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    59
Importing patches:
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    60
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    61
 Fast:
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    62
 $ patch < ../p/foo.patch
2208
12e36dedf668 update README.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2031
diff changeset
    63
 $ hg commit -A
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    64
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    65
 Faster:
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    66
 $ patch < ../p/foo.patch
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    67
 $ hg commit `lsdiff -p1 ../p/foo.patch`
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    68
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    69
 Fastest:
1308
2073e5a71008 Cleanup of tabs and trailing spaces.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 981
diff changeset
    70
 $ cat ../p/patchlist | xargs hg import -p1 -b ../p
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    71
205
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    72
Exporting a patch:
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    73
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    74
 (make changes)
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    75
 $ hg commit
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    76
 $ hg tip
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    77
 28237:747a537bd090880c29eae861df4d81b245aa0190
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    78
 $ hg export 28237 > foo.patch    # export changeset 28237
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    79
63
1c590d34bf61 Minor changes for release 0.4e
mpm@selenic.com
parents: 27
diff changeset
    80
Network support:
1c590d34bf61 Minor changes for release 0.4e
mpm@selenic.com
parents: 27
diff changeset
    81
445
fe48ffa3665f README tidy-up
mpm@selenic.com
parents: 330
diff changeset
    82
 # pull from the primary Mercurial repo
1308
2073e5a71008 Cleanup of tabs and trailing spaces.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 981
diff changeset
    83
 foo$ hg clone http://selenic.com/hg/
633
f597539c7abd Slim down and update README a bit
Matt Mackall <mpm@selenic.com>
parents: 631
diff changeset
    84
 foo$ cd hg
1
273ce12ad8f1 Update README to discuss remote pull, rsync, and the hg repo
mpm@selenic.com
parents: 0
diff changeset
    85
160
5c331d941c7f Update the README a bit
mpm@selenic.com
parents: 81
diff changeset
    86
 # export your current repo via HTTP with browsable interface
5c331d941c7f Update the README a bit
mpm@selenic.com
parents: 81
diff changeset
    87
 foo$ hg serve -n "My repo" -p 80
1308
2073e5a71008 Cleanup of tabs and trailing spaces.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 981
diff changeset
    88
327
a9ad98a9c9bc Tweak README for branch, push, and .hgrc
mpm@selenic.com
parents: 261
diff changeset
    89
 # pushing changes to a remote repo with SSH
a9ad98a9c9bc Tweak README for branch, push, and .hgrc
mpm@selenic.com
parents: 261
diff changeset
    90
 foo$ hg push ssh://user@example.com/~/hg/
a9ad98a9c9bc Tweak README for branch, push, and .hgrc
mpm@selenic.com
parents: 261
diff changeset
    91
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    92
 # merge changes from a remote machine
261
3dae0296551d Update README
mpm@selenic.com
parents: 241
diff changeset
    93
 bar$ hg pull http://foo/
2208
12e36dedf668 update README.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2031
diff changeset
    94
 bar$ hg merge   # merge changes into your working directory
63
1c590d34bf61 Minor changes for release 0.4e
mpm@selenic.com
parents: 27
diff changeset
    95
160
5c331d941c7f Update the README a bit
mpm@selenic.com
parents: 81
diff changeset
    96
 # Set up a CGI server on your webserver
445
fe48ffa3665f README tidy-up
mpm@selenic.com
parents: 330
diff changeset
    97
 foo$ cp hgweb.cgi ~/public_html/hg/index.cgi
fe48ffa3665f README tidy-up
mpm@selenic.com
parents: 330
diff changeset
    98
 foo$ emacs ~/public_html/hg/index.cgi # adjust the defaults
969
1d5b97537561 Minor README updates
mpm@selenic.com
parents: 633
diff changeset
    99
1d5b97537561 Minor README updates
mpm@selenic.com
parents: 633
diff changeset
   100
For more info:
1d5b97537561 Minor README updates
mpm@selenic.com
parents: 633
diff changeset
   101
1d5b97537561 Minor README updates
mpm@selenic.com
parents: 633
diff changeset
   102
 Documentation in doc/
1d5b97537561 Minor README updates
mpm@selenic.com
parents: 633
diff changeset
   103
 Mercurial website at http://selenic.com/mercurial