Show More
@@ -1,96 +1,98 b'' | |||||
1 | MERCURIAL QUICK-START |
|
1 | MERCURIAL QUICK-START | |
2 |
|
2 | |||
3 | Setting up Mercurial: |
|
3 | Setting up Mercurial: | |
4 |
|
4 | |||
5 | Note: some distributions fails to include bits of distutils by |
|
5 | Note: some distributions fails to include bits of distutils by | |
6 | default, you'll need python-dev to install. You'll also need a C |
|
6 | default, you'll need python-dev to install. You'll also need a C | |
7 | compiler and a 3-way merge tool like merge, tkdiff, or kdiff3. |
|
7 | compiler and a 3-way merge tool like merge, tkdiff, or kdiff3. | |
8 |
|
8 | |||
9 | First, unpack the source: |
|
9 | First, unpack the source: | |
10 |
|
10 | |||
11 | $ tar xvzf mercurial-<ver>.tar.gz |
|
11 | $ tar xvzf mercurial-<ver>.tar.gz | |
12 | $ cd mercurial-<ver> |
|
12 | $ cd mercurial-<ver> | |
13 |
|
13 | |||
14 | When installing, change python to python2.3 or python2.4 if 2.2 is the |
|
14 | When installing, change python to python2.3 or python2.4 if 2.2 is the | |
15 | default on your system. |
|
15 | default on your system. | |
16 |
|
16 | |||
17 | To install system-wide: |
|
17 | To install system-wide: | |
18 |
|
18 | |||
19 | $ python setup.py install --force |
|
19 | $ python setup.py install --force | |
20 |
|
20 | |||
21 | To install in your home directory (~/bin and ~/lib, actually), run: |
|
21 | To install in your home directory (~/bin and ~/lib, actually), run: | |
22 |
|
22 | |||
23 | $ python setup.py install --home=${HOME} --force |
|
23 | $ python setup.py install --home=${HOME} --force | |
24 | $ export PYTHONPATH=${HOME}/lib/python # (or lib64/ on some systems) |
|
24 | $ export PYTHONPATH=${HOME}/lib/python # (or lib64/ on some systems) | |
25 | $ export PATH=${HOME}/bin:$PATH # add these to your .bashrc |
|
25 | $ export PATH=${HOME}/bin:$PATH # add these to your .bashrc | |
26 |
|
26 | |||
27 | And finally: |
|
27 | And finally: | |
28 |
|
28 | |||
29 | $ hg # test installation, show help |
|
29 | $ hg # test installation, show help | |
30 |
|
30 | |||
31 | If you get complaints about missing modules, you probably haven't set |
|
31 | If you get complaints about missing modules, you probably haven't set | |
32 | PYTHONPATH correctly. |
|
32 | PYTHONPATH correctly. | |
33 |
|
33 | |||
34 | Setting up a Mercurial project: |
|
34 | Setting up a Mercurial project: | |
35 |
|
35 | |||
36 | $ hg init project # creates project directory |
|
36 | $ hg init project # creates project directory | |
37 | $ cd project |
|
37 | $ cd project | |
38 | # copy files in, edit them |
|
38 | # copy files in, edit them | |
39 | $ hg add # add all unknown files |
|
39 | $ hg add # add all unknown files | |
40 | $ hg commit # commit all changes, edit changelog entry |
|
40 | $ hg commit # commit all changes, edit changelog entry | |
41 |
|
41 | |||
42 | Mercurial will look for a file named .hgignore in the root of your |
|
42 | Mercurial will look for a file named .hgignore in the root of your | |
43 | repository which contains a set of regular expressions to ignore in |
|
43 | repository which contains a set of regular expressions to ignore in | |
44 | file paths. |
|
44 | file paths. | |
45 |
|
45 | |||
46 | Branching and merging: |
|
46 | Branching and merging: | |
47 |
|
47 | |||
48 | $ hg clone project project-work # create a new branch |
|
48 | $ hg clone project project-work # create a new branch | |
49 | $ cd project-work |
|
49 | $ cd project-work | |
50 | $ <make changes> |
|
50 | $ <make changes> | |
51 | $ hg commit |
|
51 | $ hg commit | |
52 | $ cd ../project |
|
52 | $ cd ../project | |
53 | $ hg pull ../project-work # pull changesets from project-work |
|
53 | $ hg pull ../project-work # pull changesets from project-work | |
54 | $ hg merge # merge the new tip from project-work into |
|
54 | $ hg merge # merge the new tip from project-work into | |
55 | # our working directory |
|
55 | # our working directory | |
56 | $ hg commit # commit the result of the merge |
|
56 | $ hg commit # commit the result of the merge | |
57 |
|
57 | |||
58 | Importing patches: |
|
58 | Importing patches: | |
59 |
|
59 | |||
60 | Simple: |
|
60 | Simple: | |
61 | $ patch < ../p/foo.patch |
|
61 | $ patch < ../p/foo.patch | |
62 | $ hg commit -A |
|
62 | $ hg commit -A | |
63 |
|
63 | |||
64 | Fast: |
|
64 | Fast: | |
65 | $ cat ../p/patchlist | xargs hg import -p1 -b ../p |
|
65 | $ cat ../p/patchlist | xargs hg import -p1 -b ../p | |
66 |
|
66 | |||
67 | Exporting a patch: |
|
67 | Exporting a patch: | |
68 |
|
68 | |||
69 | (make changes) |
|
69 | (make changes) | |
70 | $ hg commit |
|
70 | $ hg commit | |
71 | $ hg export tip > foo.patch # export latest change |
|
71 | $ hg export tip > foo.patch # export latest change | |
72 |
|
72 | |||
73 | Network support: |
|
73 | Network support: | |
74 |
|
74 | |||
75 | # pull from the primary Mercurial repo |
|
75 | # pull from the primary Mercurial repo | |
76 | foo$ hg clone http://selenic.com/hg/ |
|
76 | foo$ hg clone http://selenic.com/hg/ | |
77 | foo$ cd hg |
|
77 | foo$ cd hg | |
78 |
|
78 | |||
79 | # export your current repo via HTTP with browsable interface |
|
79 | # make your current repo available via http://server:8000/ | |
80 | foo$ hg serve -n "My repo" -p 80 |
|
80 | foo$ hg serve | |
81 |
|
81 | |||
82 | # pushing changes to a remote repo with SSH |
|
82 | # pushing and pulling changes to/from a remote repo with SSH | |
83 |
foo$ hg push ssh://user@example.com/ |
|
83 | foo$ hg push ssh://user@example.com/my/repository | |
|
84 | foo$ hg pull ssh://user@example.com//home/somebody/his/repository | |||
84 |
|
85 | |||
85 | # merge changes from a remote machine |
|
86 | # merge changes from a remote machine (e.g. running 'hg serve') | |
86 | bar$ hg pull http://foo/ |
|
87 | bar$ hg pull http://foo:8000/ | |
87 | bar$ hg merge # merge changes into your working directory |
|
88 | bar$ hg merge # merge changes into your working directory | |
|
89 | bar$ hg commit # commit merge in to your local repository | |||
88 |
|
90 | |||
89 | # Set up a CGI server on your webserver |
|
91 | # Set up a CGI server on your webserver | |
90 | foo$ cp hgweb.cgi ~/public_html/hg/index.cgi |
|
92 | foo$ cp hgweb.cgi ~/public_html/hg/index.cgi | |
91 | foo$ emacs ~/public_html/hg/index.cgi # adjust the defaults |
|
93 | foo$ emacs ~/public_html/hg/index.cgi # adjust the defaults | |
92 |
|
94 | |||
93 | For more info: |
|
95 | For more info: | |
94 |
|
96 | |||
95 | Documentation in doc/ |
|
97 | Documentation in doc/ | |
96 | Mercurial website at http://selenic.com/mercurial |
|
98 | Mercurial website at http://selenic.com/mercurial |
General Comments 0
You need to be logged in to leave comments.
Login now