README
author mpm@selenic.com
Sat, 04 Jun 2005 23:37:11 -0800
changeset 259 45c293b71341
parent 241 afe895fcc0d0
child 261 3dae0296551d
permissions -rw-r--r--
fix addremove -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 fix addremove manifest hash: 15a37c156e2186e89ef086ef974541bf1c695280 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCoqunywK+sNU5EO8RAuICAJ9x7W0xz1ZBJ7nFYiiQEBljyYwqhACfVE7R oiP0nigB4SzQMMmifrQ7UkA= =/c5l -----END PGP SIGNATURE-----
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
     1
Setting up Mercurial:
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
     2
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
     3
 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
     4
 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
     5
 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
     6
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
     7
 First, unpack the source:
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
     8
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
     9
 $ tar xvzf mercurial-<ver>.tar.gz
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    10
 $ cd mercurial-<ver>
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
    11
205
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    12
 To install system-wide:
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
    13
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
    14
 $ python setup.py install   # change python to python2.3 if 2.2 is default
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
    15
205
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    16
 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
    17
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
    18
 $ python2.3 setup.py install --home=~
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    19
 $ export PYTHONPATH=${HOME}/lib/python  # add this to your .bashrc
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
    20
 $ export PATH=${HOME}/bin:$PATH         # 
205
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    21
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
    22
 And finally:
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
    23
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    24
 $ hg                                    # test installation, show help
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    25
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    26
 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
    27
 PYTHONPATH correctly.
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    28
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    29
Setting up a Mercurial project:
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
 $ cd linux/
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    32
 $ hg init         # creates .hg
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    33
 $ hg status       # show changes between repo and working dir
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    34
 $ hg diff         # generate a unidiff
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    35
 $ hg addremove    # add all unknown files and remove all missing files
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    36
 $ hg commit       # commit all changes, edit changelog entry
160
5c331d941c7f Update the README a bit
mpm@selenic.com
parents: 81
diff changeset
    37
 $ hg export       # export a changeset as a diff
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    38
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    39
 Mercurial will look for a file named .hgignore in the root of your
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    40
 repository contains a set of regular expressions to ignore in file
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    41
 paths.
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 commands:
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    44
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    45
 $ hg history          # show changesets
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    46
 $ hg log Makefile     # show commits per file
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    47
 $ hg checkout         # check out the tip revision
160
5c331d941c7f Update the README a bit
mpm@selenic.com
parents: 81
diff changeset
    48
 $ hg checkout <id>    # check out a specified changeset
5c331d941c7f Update the README a bit
mpm@selenic.com
parents: 81
diff changeset
    49
                       # IDs can be tags, revision numbers, or unique
5c331d941c7f Update the README a bit
mpm@selenic.com
parents: 81
diff changeset
    50
                       # subsets of changeset hash numbers
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    51
 $ hg add foo          # add a new file for the next commit
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    52
 $ hg remove bar       # mark a file as removed
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    53
 $ hg verify           # check repo integrity
67
a182f2561c8e Add tag support
mpm@selenic.com
parents: 63
diff changeset
    54
 $ hg tags             # show current tags
81
17884f79d59d Add annotate and blame to the command list and README
mpm@selenic.com
parents: 67
diff changeset
    55
 $ hg annotate [files] # show changeset numbers for each file line
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    56
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    57
Branching and merging:
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
 $ cd ..
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    60
 $ mkdir linux-work
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    61
 $ cd linux-work
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    62
 $ hg branch ../linux        # create a new branch
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    63
 $ hg checkout               # populate the working directory
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    64
 $ <make changes>
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    65
 $ hg commit
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    66
 $ cd ../linux
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    67
 $ hg merge ../linux-work    # pull changesets from linux-work
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
Importing patches:
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    70
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    71
 Fast:
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    72
 $ patch < ../p/foo.patch
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    73
 $ hg addremove
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    74
 $ hg commit
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    75
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    76
 Faster:
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    77
 $ patch < ../p/foo.patch
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    78
 $ hg commit `lsdiff -p1 ../p/foo.patch`
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    79
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    80
 Fastest:
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    81
 $ cat ../p/patchlist | xargs hg import -p1 -b ../p 
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
    82
205
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    83
Exporting a patch:
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    84
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    85
 (make changes)
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    86
 $ hg commit
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    87
 $ hg tip
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    88
 28237:747a537bd090880c29eae861df4d81b245aa0190
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    89
 $ hg export 28237 > foo.patch    # export changeset 28237
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
    90
63
1c590d34bf61 Minor changes for release 0.4e
mpm@selenic.com
parents: 27
diff changeset
    91
Network support:
1c590d34bf61 Minor changes for release 0.4e
mpm@selenic.com
parents: 27
diff changeset
    92
1
273ce12ad8f1 Update README to discuss remote pull, rsync, and the hg repo
mpm@selenic.com
parents: 0
diff changeset
    93
 # pull the self-hosting hg repo
273ce12ad8f1 Update README to discuss remote pull, rsync, and the hg repo
mpm@selenic.com
parents: 0
diff changeset
    94
 foo$ hg init
273ce12ad8f1 Update README to discuss remote pull, rsync, and the hg repo
mpm@selenic.com
parents: 0
diff changeset
    95
 foo$ hg merge http://selenic.com/hg/
27
febfb35d2a3e hg co after hg merge
mpm@selenic.com
parents: 1
diff changeset
    96
 foo$ hg checkout  # hg co works too
1
273ce12ad8f1 Update README to discuss remote pull, rsync, and the hg repo
mpm@selenic.com
parents: 0
diff changeset
    97
160
5c331d941c7f Update the README a bit
mpm@selenic.com
parents: 81
diff changeset
    98
 # export your current repo via HTTP with browsable interface
5c331d941c7f Update the README a bit
mpm@selenic.com
parents: 81
diff changeset
    99
 foo$ hg serve -n "My repo" -p 80
5c331d941c7f Update the README a bit
mpm@selenic.com
parents: 81
diff changeset
   100
 
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
   101
 # merge changes from a remote machine
176
1d8e9637a0a4 Change hg: protocol name to http: and http: to old-http:
mpm@selenic.com
parents: 160
diff changeset
   102
 bar$ hg merge http://foo/
160
5c331d941c7f Update the README a bit
mpm@selenic.com
parents: 81
diff changeset
   103
 bar$ hg co        # checkout the result
63
1c590d34bf61 Minor changes for release 0.4e
mpm@selenic.com
parents: 27
diff changeset
   104
160
5c331d941c7f Update the README a bit
mpm@selenic.com
parents: 81
diff changeset
   105
 # Set up a CGI server on your webserver
5c331d941c7f Update the README a bit
mpm@selenic.com
parents: 81
diff changeset
   106
 foo$ cp hgweb.cgi ~/public_html/hg-linux/index.cgi
5c331d941c7f Update the README a bit
mpm@selenic.com
parents: 81
diff changeset
   107
 foo$ emacs ~/public_html/hg-linux/index.cgi # adjust the defaults
63
1c590d34bf61 Minor changes for release 0.4e
mpm@selenic.com
parents: 27
diff changeset
   108
204
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
   109
Symbolic repository names:
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
   110
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
   111
 Mercurial uses an optional file called ~/.hgpaths to track repo
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
   112
 locations symbolically. Simply add a line with the name, a space, and
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
   113
 a URL:
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
   114
161cef501e8d README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents: 182
diff changeset
   115
 foo$ echo "main http://selenic.com/hg/" >> ~/.hgpaths
179
ff5377a4b203 Add ~/.hgpaths to README
mpm@selenic.com
parents: 178
diff changeset
   116
 foo$ hg merge main
ff5377a4b203 Add ~/.hgpaths to README
mpm@selenic.com
parents: 178
diff changeset
   117
 foo$ hg co