Mercurial > hg > mercurial-crew-with-dirclash
annotate README @ 1803:06e7447c7302
speed up hg log --patch
Changing dodiff to read the manifest/changelog for node1 before calling
repo.update allows us to take advantage of the revlog revision cache.
Before this patch and my previous "speed up hg log --debug" patch, when
using hg log -p to display three revisions (A, B and C), dodiff and
repo.changes would end up reading the manifests in this order:
B A B A C B C B
With both patches, this order becomes:
A A B B B B C C
(This considers only dodiff and repo.changes. I'm not sure how other
parts of hg log enter the picture.)
The speed up will depend on the revisions being displayed. (All
"before" times already have my previous "speed up hg log --debug" patch
applied.)
hg repo (tip = 414e81ae971f). hg log -p
before after
real 0m50.981s 0m45.279s
user 0m47.930s 0m42.560s
sys 0m2.526s 0m2.523s
output size: 6917897 bytes
kernel repo (tip = 9d4e135960ed). hg log -p -l64
before after
real 2m14.995s 1m45.025s
user 2m9.509s 1m33.900s
sys 0m3.663s 0m2.942s
output size: 31497621 bytes
same kernel repo. hg log -p -l64 -r c84c2069592f:0
before after
real 1m48.045s 1m0.076s
user 1m44.094s 0m58.492s
sys 0m2.603s 0m1.103s
output size: 197983 bytes
c84c2069592f was the tip of a 10 day old kernel repo that I had lying
around and was where I first tested this patch. For some weird
coincidence it's also a place where the patch makes a huge difference.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Sun, 26 Feb 2006 02:26:17 +0100 |
parents | 2073e5a71008 |
children | d242719c716e |
rev | line source |
---|---|
445 | 1 MERCURIAL QUICK-START |
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 |
205
d255d99a7cbd
README: integrate some changes from Kevin Smith
mpm@selenic.com
parents:
204
diff
changeset
|
14 To install system-wide: |
204
161cef501e8d
README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents:
182
diff
changeset
|
15 |
161cef501e8d
README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents:
182
diff
changeset
|
16 $ 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
|
17 |
205
d255d99a7cbd
README: integrate some changes from Kevin Smith
mpm@selenic.com
parents:
204
diff
changeset
|
18 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
|
19 |
161cef501e8d
README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents:
182
diff
changeset
|
20 $ python2.3 setup.py install --home=~ |
507 | 21 $ export PYTHONPATH=${HOME}/lib/python # (or lib64/ on some systems) |
22 $ 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
|
23 |
204
161cef501e8d
README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents:
182
diff
changeset
|
24 And finally: |
161cef501e8d
README: integrate various changes and suggestions from Rafael Villar Burke
mpm@selenic.com
parents:
182
diff
changeset
|
25 |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
26 $ hg # test installation, show help |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
27 |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
28 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
|
29 PYTHONPATH correctly. |
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 Setting up a Mercurial project: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
32 |
445 | 33 $ cd project/ |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
34 $ hg init # creates .hg |
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 |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
37 |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
38 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
|
39 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
|
40 file paths. |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
41 |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
42 Branching and merging: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
43 |
633
f597539c7abd
Slim down and update README a bit
Matt Mackall <mpm@selenic.com>
parents:
631
diff
changeset
|
44 $ 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
|
45 $ cd linux-work |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
46 $ <make changes> |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
47 $ hg commit |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
48 $ cd ../linux |
261 | 49 $ hg pull ../linux-work # pull changesets from linux-work |
445 | 50 $ hg update -m # merge the new tip from linux-work into |
261 | 51 # our working directory |
633
f597539c7abd
Slim down and update README a bit
Matt Mackall <mpm@selenic.com>
parents:
631
diff
changeset
|
52 $ 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
|
53 |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
54 Importing patches: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
55 |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
56 Fast: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
57 $ patch < ../p/foo.patch |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
58 $ hg addremove |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
59 $ hg commit |
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 Faster: |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
62 $ patch < ../p/foo.patch |
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
63 $ hg commit `lsdiff -p1 ../p/foo.patch` |
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 Fastest: |
1308
2073e5a71008
Cleanup of tabs and trailing spaces.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
981
diff
changeset
|
66 $ 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
|
67 |
205
d255d99a7cbd
README: integrate some changes from Kevin Smith
mpm@selenic.com
parents:
204
diff
changeset
|
68 Exporting a patch: |
d255d99a7cbd
README: integrate some changes from Kevin Smith
mpm@selenic.com
parents:
204
diff
changeset
|
69 |
d255d99a7cbd
README: integrate some changes from Kevin Smith
mpm@selenic.com
parents:
204
diff
changeset
|
70 (make changes) |
d255d99a7cbd
README: integrate some changes from Kevin Smith
mpm@selenic.com
parents:
204
diff
changeset
|
71 $ hg commit |
d255d99a7cbd
README: integrate some changes from Kevin Smith
mpm@selenic.com
parents:
204
diff
changeset
|
72 $ hg tip |
d255d99a7cbd
README: integrate some changes from Kevin Smith
mpm@selenic.com
parents:
204
diff
changeset
|
73 28237:747a537bd090880c29eae861df4d81b245aa0190 |
d255d99a7cbd
README: integrate some changes from Kevin Smith
mpm@selenic.com
parents:
204
diff
changeset
|
74 $ hg export 28237 > foo.patch # export changeset 28237 |
d255d99a7cbd
README: integrate some changes from Kevin Smith
mpm@selenic.com
parents:
204
diff
changeset
|
75 |
63 | 76 Network support: |
77 | |
445 | 78 # pull from the primary Mercurial repo |
1308
2073e5a71008
Cleanup of tabs and trailing spaces.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
981
diff
changeset
|
79 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
|
80 foo$ cd hg |
1
273ce12ad8f1
Update README to discuss remote pull, rsync, and the hg repo
mpm@selenic.com
parents:
0
diff
changeset
|
81 |
160 | 82 # export your current repo via HTTP with browsable interface |
83 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
|
84 |
327 | 85 # pushing changes to a remote repo with SSH |
86 foo$ hg push ssh://user@example.com/~/hg/ | |
87 | |
0
9117c6561b0b
Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff
changeset
|
88 # merge changes from a remote machine |
261 | 89 bar$ hg pull http://foo/ |
445 | 90 bar$ hg update -m # merge changes into your working directory |
63 | 91 |
160 | 92 # Set up a CGI server on your webserver |
445 | 93 foo$ cp hgweb.cgi ~/public_html/hg/index.cgi |
94 foo$ emacs ~/public_html/hg/index.cgi # adjust the defaults | |
969 | 95 |
96 For more info: | |
97 | |
98 Documentation in doc/ | |
99 Mercurial website at http://selenic.com/mercurial | |
100 Mercurial wiki at http://selenic.com/mercurial/wiki |