Show More
@@ -1,102 +1,88 b'' | |||
|
1 | 1 | Setting up Mercurial in your home directory: |
|
2 | 2 | |
|
3 | 3 | Note: Debian fails to include bits of distutils, you'll need |
|
4 | 4 | python-dev to install. Alternately, shove everything somewhere in |
|
5 | 5 | your path. |
|
6 | 6 | |
|
7 | 7 | $ tar xvzf mercurial-<ver>.tar.gz |
|
8 | 8 | $ cd mercurial-<ver> |
|
9 | 9 | $ python2.3 setup.py install --home ~ |
|
10 | 10 | $ export PYTHONPATH=${HOME}/lib/python # add this to your .bashrc |
|
11 | 11 | $ export HGMERGE=tkmerge # customize this |
|
12 | 12 | $ hg # test installation, show help |
|
13 | 13 | |
|
14 | 14 | If you get complaints about missing modules, you probably haven't set |
|
15 | 15 | PYTHONPATH correctly. |
|
16 | 16 | |
|
17 | 17 | Setting up a Mercurial project: |
|
18 | 18 | |
|
19 | 19 | $ cd linux/ |
|
20 | 20 | $ hg init # creates .hg |
|
21 | 21 | $ hg status # show changes between repo and working dir |
|
22 | 22 | $ hg diff # generate a unidiff |
|
23 | $ hg export # export a changeset as a diff | |
|
24 | 23 | $ hg addremove # add all unknown files and remove all missing files |
|
25 | 24 | $ hg commit # commit all changes, edit changelog entry |
|
25 | $ hg export # export a changeset as a diff | |
|
26 | 26 | |
|
27 | 27 | Mercurial will look for a file named .hgignore in the root of your |
|
28 | 28 | repository contains a set of regular expressions to ignore in file |
|
29 | 29 | paths. |
|
30 | 30 | |
|
31 | 31 | Mercurial commands: |
|
32 | 32 | |
|
33 | 33 | $ hg history # show changesets |
|
34 | 34 | $ hg log Makefile # show commits per file |
|
35 | 35 | $ hg checkout # check out the tip revision |
|
36 |
$ hg checkout < |
|
|
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 | 39 | $ hg add foo # add a new file for the next commit |
|
38 | 40 | $ hg remove bar # mark a file as removed |
|
39 | 41 | $ hg verify # check repo integrity |
|
40 | 42 | $ hg tags # show current tags |
|
41 | 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 | 45 | Branching and merging: |
|
45 | 46 | |
|
46 | 47 | $ cd .. |
|
47 | 48 | $ mkdir linux-work |
|
48 | 49 | $ cd linux-work |
|
49 | 50 | $ hg branch ../linux # create a new branch |
|
50 | 51 | $ hg checkout # populate the working directory |
|
51 | 52 | $ <make changes> |
|
52 | 53 | $ hg commit |
|
53 | 54 | $ cd ../linux |
|
54 | 55 | $ hg merge ../linux-work # pull changesets from linux-work |
|
55 | 56 | |
|
56 | 57 | Importing patches: |
|
57 | 58 | |
|
58 | 59 | Fast: |
|
59 | 60 | $ patch < ../p/foo.patch |
|
60 | 61 | $ hg addremove |
|
61 | 62 | $ hg commit |
|
62 | 63 | |
|
63 | 64 | Faster: |
|
64 | 65 | $ patch < ../p/foo.patch |
|
65 | 66 | $ hg commit `lsdiff -p1 ../p/foo.patch` |
|
66 | 67 | |
|
67 | 68 | Fastest: |
|
68 | 69 | $ cat ../p/patchlist | xargs hg import -p1 -b ../p |
|
69 | 70 | |
|
70 | 71 | Network support: |
|
71 | 72 | |
|
72 | The simple way: | |
|
73 | ||
|
74 | 73 | # pull the self-hosting hg repo |
|
75 | 74 | foo$ hg init |
|
76 | 75 | foo$ hg merge http://selenic.com/hg/ |
|
77 | 76 | foo$ hg checkout # hg co works too |
|
78 | 77 | |
|
79 | # export your .hg directory as a directory on your webserver | |
|
80 | foo$ ln -s .hg ~/public_html/hg-linux | |
|
78 | # export your current repo via HTTP with browsable interface | |
|
79 | foo$ hg serve -n "My repo" -p 80 | |
|
81 | 80 | |
|
82 | 81 | # merge changes from a remote machine |
|
83 |
bar$ hg merge h |
|
|
84 | ||
|
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 | |
|
82 | bar$ hg merge hg://foo/ | |
|
83 | bar$ hg co # checkout the result | |
|
91 | 84 | |
|
92 |
# Set up |
|
|
93 |
foo$ |
|
|
94 |
foo$ |
|
|
85 | # Set up a CGI server on your webserver | |
|
86 | foo$ cp hgweb.cgi ~/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