##// END OF EJS Templates
Update the README a bit
mpm@selenic.com -
r160:5c331d94 default
parent child Browse files
Show More
@@ -1,102 +1,88 b''
1 Setting up Mercurial in your home directory:
1 Setting up Mercurial in your home directory:
2
2
3 Note: Debian fails to include bits of distutils, you'll need
3 Note: Debian fails to include bits of distutils, you'll need
4 python-dev to install. Alternately, shove everything somewhere in
4 python-dev to install. Alternately, shove everything somewhere in
5 your path.
5 your path.
6
6
7 $ tar xvzf mercurial-<ver>.tar.gz
7 $ tar xvzf mercurial-<ver>.tar.gz
8 $ cd mercurial-<ver>
8 $ cd mercurial-<ver>
9 $ python2.3 setup.py install --home ~
9 $ python2.3 setup.py install --home ~
10 $ export PYTHONPATH=${HOME}/lib/python # add this to your .bashrc
10 $ export PYTHONPATH=${HOME}/lib/python # add this to your .bashrc
11 $ export HGMERGE=tkmerge # customize this
11 $ export HGMERGE=tkmerge # customize this
12 $ hg # test installation, show help
12 $ hg # test installation, show help
13
13
14 If you get complaints about missing modules, you probably haven't set
14 If you get complaints about missing modules, you probably haven't set
15 PYTHONPATH correctly.
15 PYTHONPATH correctly.
16
16
17 Setting up a Mercurial project:
17 Setting up a Mercurial project:
18
18
19 $ cd linux/
19 $ cd linux/
20 $ hg init # creates .hg
20 $ hg init # creates .hg
21 $ hg status # show changes between repo and working dir
21 $ hg status # show changes between repo and working dir
22 $ hg diff # generate a unidiff
22 $ hg diff # generate a unidiff
23 $ hg export # export a changeset as a diff
24 $ hg addremove # add all unknown files and remove all missing files
23 $ hg addremove # add all unknown files and remove all missing files
25 $ hg commit # commit all changes, edit changelog entry
24 $ hg commit # commit all changes, edit changelog entry
25 $ hg export # export a changeset as a diff
26
26
27 Mercurial will look for a file named .hgignore in the root of your
27 Mercurial will look for a file named .hgignore in the root of your
28 repository contains a set of regular expressions to ignore in file
28 repository contains a set of regular expressions to ignore in file
29 paths.
29 paths.
30
30
31 Mercurial commands:
31 Mercurial commands:
32
32
33 $ hg history # show changesets
33 $ hg history # show changesets
34 $ hg log Makefile # show commits per file
34 $ hg log Makefile # show commits per file
35 $ hg checkout # check out the tip revision
35 $ hg checkout # check out the tip revision
36 $ hg checkout <hash> # check out a specified changeset
36 $ hg checkout <id> # check out a specified changeset
37 # IDs can be tags, revision numbers, or unique
38 # subsets of changeset hash numbers
37 $ hg add foo # add a new file for the next commit
39 $ hg add foo # add a new file for the next commit
38 $ hg remove bar # mark a file as removed
40 $ hg remove bar # mark a file as removed
39 $ hg verify # check repo integrity
41 $ hg verify # check repo integrity
40 $ hg tags # show current tags
42 $ hg tags # show current tags
41 $ hg annotate [files] # show changeset numbers for each file line
43 $ hg annotate [files] # show changeset numbers for each file line
42 $ hg blame [files] # show commit users for each file line
43
44
44 Branching and merging:
45 Branching and merging:
45
46
46 $ cd ..
47 $ cd ..
47 $ mkdir linux-work
48 $ mkdir linux-work
48 $ cd linux-work
49 $ cd linux-work
49 $ hg branch ../linux # create a new branch
50 $ hg branch ../linux # create a new branch
50 $ hg checkout # populate the working directory
51 $ hg checkout # populate the working directory
51 $ <make changes>
52 $ <make changes>
52 $ hg commit
53 $ hg commit
53 $ cd ../linux
54 $ cd ../linux
54 $ hg merge ../linux-work # pull changesets from linux-work
55 $ hg merge ../linux-work # pull changesets from linux-work
55
56
56 Importing patches:
57 Importing patches:
57
58
58 Fast:
59 Fast:
59 $ patch < ../p/foo.patch
60 $ patch < ../p/foo.patch
60 $ hg addremove
61 $ hg addremove
61 $ hg commit
62 $ hg commit
62
63
63 Faster:
64 Faster:
64 $ patch < ../p/foo.patch
65 $ patch < ../p/foo.patch
65 $ hg commit `lsdiff -p1 ../p/foo.patch`
66 $ hg commit `lsdiff -p1 ../p/foo.patch`
66
67
67 Fastest:
68 Fastest:
68 $ cat ../p/patchlist | xargs hg import -p1 -b ../p
69 $ cat ../p/patchlist | xargs hg import -p1 -b ../p
69
70
70 Network support:
71 Network support:
71
72
72 The simple way:
73
74 # pull the self-hosting hg repo
73 # pull the self-hosting hg repo
75 foo$ hg init
74 foo$ hg init
76 foo$ hg merge http://selenic.com/hg/
75 foo$ hg merge http://selenic.com/hg/
77 foo$ hg checkout # hg co works too
76 foo$ hg checkout # hg co works too
78
77
79 # export your .hg directory as a directory on your webserver
78 # export your current repo via HTTP with browsable interface
80 foo$ ln -s .hg ~/public_html/hg-linux
79 foo$ hg serve -n "My repo" -p 80
81
80
82 # merge changes from a remote machine
81 # merge changes from a remote machine
83 bar$ hg merge http://foo/~user/hg-linux
82 bar$ hg merge hg://foo/
84
83 bar$ hg co # checkout the result
85 The new, fast, experimental way:
86
87 # pull the self-hosting hg repo
88 foo$ hg init
89 foo$ hg merge hg://selenic.com/hg/
90 foo$ hg checkout # hg co works too
91
84
92 # Set up the CGI server on your webserver
85 # Set up a CGI server on your webserver
93 foo$ ln -s .hg ~/public_html/hg-linux/.hg
86 foo$ cp hgweb.cgi ~/public_html/hg-linux/index.cgi
94 foo$ cp hgweb.py ~/public_html/hg-linux/index.cgi
87 foo$ emacs ~/public_html/hg-linux/index.cgi # adjust the defaults
95
88
96 # merge changes from a remote machine
97 bar$ hg merge hg://foo/~user/hg-linux
98
99 Another approach which does perform well right now is to use rsync.
100 Simply rsync the remote repo to a read-only local copy and then do a
101 local pull.
102
General Comments 0
You need to be logged in to leave comments. Login now