Mercurial > hg
annotate contrib/mercurial.spec @ 16777:058e14da7044
graphlog: turn getlogrevs() into a generator
This improves the poor "time to first changeset" compared to the
original log command. When running:
$ hg log -u user
log will enumerate the changelog and display matching revisions when
they are found. But:
$ hg log -G -u user
will first find all revisions matching the user then start to display
them.
Initially, I considered turning revset.match() into a generator. This is
doable but requires a fair amount of work. Instead,
cmdutil.increasingwindows() is reused to call the revset matcher
repeatedly. This has the nice properties of:
- Let us reorder the windows after filtering, which is necessary as the
matcher can reorder inputs but is an internal detail not a feature.
- Let us feed the matcher with windows in changelog order, which is good
for performances.
- Have a generator designed for log-like commands, returning small
windows at first then batching larger ones.
I feel that calling the matcher multiple times is correct, at least with
the revsets involved in getlogrevs() because they are:
- stateless (no limit())
- respecting f(a|b) = f(a) | f(b), though I have no valid argument about
that.
Known issues compared to log code:
- Calling the revset matcher multiple times can be slow when revset
functions have to create expensive data structure for filtering. This
will be addressed in a followup.
- Predicate combinations like "--user foo --user bar" or "--user foo and
--branch bar" are inherently slower because all input revision are
checked against the first condition, then against the second, and so
forth. log would enumerate the input revisions once and check each of
them once against all conditions, which is faster. There are solutions
but nothing cheap to implement.
Some numbers against mozilla repository:
first line total
* hg log -u rnewman
/Users/pmezard/bin/hg-2.2 0.148s 7.293s
/Users/pmezard/bin/hgdev 0.132s 5.747s
* hg log -u rnewman -u girard
/Users/pmezard/bin/hg-2.2 0.146s 7.323s
/Users/pmezard/bin/hgdev 0.136s 11.096s
* hg log -l 10
/Users/pmezard/bin/hg-2.2 0.137s 0.153s
/Users/pmezard/bin/hgdev 0.128s 0.144s
* hg log -l 10 -u rnewman
/Users/pmezard/bin/hg-2.2 0.146s 0.265s
/Users/pmezard/bin/hgdev 0.133s 0.236s
* hg log -b GECKO193a2_20100228_RELBRANCH
/Users/pmezard/bin/hg-2.2 2.332s 6.618s
/Users/pmezard/bin/hgdev 1.972s 5.543s
* hg log xulrunner
/Users/pmezard/bin/hg-2.2 5.829s 5.958s
/Users/pmezard/bin/hgdev 0.194s 6.017s
* hg log --follow xulrunner/build.mk
/Users/pmezard/bin/hg-2.2 0.353s 0.438s
/Users/pmezard/bin/hgdev 0.394s 0.580s
* hg log -u girard tools
/Users/pmezard/bin/hg-2.2 5.853s 6.012s
/Users/pmezard/bin/hgdev 0.195s 6.030s
* hg log -b COMM2000_20110314_RELBRANCH --copies
/Users/pmezard/bin/hg-2.2 2.231s 6.653s
/Users/pmezard/bin/hgdev 1.897s 5.585s
* hg log --follow
/Users/pmezard/bin/hg-2.2 0.137s 14.140s
/Users/pmezard/bin/hgdev 0.381s 44.246s
* hg log --follow -r 80000:90000
/Users/pmezard/bin/hg-2.2 0.127s 1.611s
/Users/pmezard/bin/hgdev 0.147s 1.847s
* hg log --follow -r 90000:80000
/Users/pmezard/bin/hg-2.2 0.130s 1.702s
/Users/pmezard/bin/hgdev 0.368s 6.106s
* hg log --follow -r 80000:90000 js/src/jsproxy.cpp
/Users/pmezard/bin/hg-2.2 0.343s 0.388s
/Users/pmezard/bin/hgdev 0.437s 0.631s
* hg log --follow -r 90000:80000 js/src/jsproxy.cpp
/Users/pmezard/bin/hg-2.2 0.342s 0.389s
/Users/pmezard/bin/hgdev 0.442s 0.628s
author | Patrick Mezard <patrick@mezard.eu> |
---|---|
date | Tue, 08 May 2012 22:43:44 +0200 |
parents | 85439f43749f |
children | 5337cb17fa1f |
rev | line source |
---|---|
12056
85439f43749f
mercurial.spec: specify file modes for install
Mads Kiilerich <mads@kiilerich.com>
parents:
11845
diff
changeset
|
1 Summary: A fast, lightweight Source Control Management system |
459 | 2 Name: mercurial |
3863
1ef8ada4370f
Remove hard-coded version numbers and release notes from packaging
Matt Mackall <mpm@selenic.com>
parents:
1891
diff
changeset
|
3 Version: snapshot |
1891
e5c8e38b788f
New version/release in mercurial.spec, patchbomb is now in hgext.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1890
diff
changeset
|
4 Release: 0 |
10263 | 5 License: GPLv2+ |
459 | 6 Group: Development/Tools |
8942
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
7 URL: http://mercurial.selenic.com/ |
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
8 Source0: http://mercurial.selenic.com/release/%{name}-%{version}.tar.gz |
7424 | 9 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root |
459 | 10 |
4751 | 11 # From the README: |
12 # | |
13 # Note: some distributions fails to include bits of distutils by | |
14 # default, you'll need python-dev to install. You'll also need a C | |
15 # compiler and a 3-way merge tool like merge, tkdiff, or kdiff3. | |
16 # | |
17 # python-devel provides an adequate python-dev. The merge tool is a | |
18 # run-time dependency. | |
19 # | |
11845
85de44ae0238
mercurial.spec: gettext is a build requirement for getting proper localization
Mads Kiilerich <mads@kiilerich.com>
parents:
11512
diff
changeset
|
20 BuildRequires: python >= 2.4, python-devel, make, gcc, python-docutils >= 0.5, gettext |
8942
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
21 Provides: hg = %{version}-%{release} |
10255
26fc868cb8b0
mercurial.spec: Alignment with AIX spec by Jim Hague
Mads Kiilerich <mads@kiilerich.com>
parents:
9635
diff
changeset
|
22 Requires: python >= 2.4 |
26fc868cb8b0
mercurial.spec: Alignment with AIX spec by Jim Hague
Mads Kiilerich <mads@kiilerich.com>
parents:
9635
diff
changeset
|
23 # The hgk extension uses the wish tcl interpreter, but we don't enforce it |
26fc868cb8b0
mercurial.spec: Alignment with AIX spec by Jim Hague
Mads Kiilerich <mads@kiilerich.com>
parents:
9635
diff
changeset
|
24 #Requires: tk |
4751 | 25 |
563 | 26 %define pythonver %(python -c 'import sys;print ".".join(map(str, sys.version_info[:2]))') |
8942
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
27 %define emacs_lispdir %{_datadir}/emacs/site-lisp |
563 | 28 |
459 | 29 %description |
30 Mercurial is a fast, lightweight source control management system designed | |
31 for efficient handling of very large distributed projects. | |
32 | |
33 %prep | |
1273
ab22af71386f
Clean up RPM spec file
Florian La Roche <laroche@redhat.com>
parents:
563
diff
changeset
|
34 %setup -q |
459 | 35 |
36 %build | |
4753
620cea146b19
mercurial.spec: include CONTRIBUTORS, COPYING and man pages in rpm
Adam Spiers <hg@adamspiers.org>
parents:
4752
diff
changeset
|
37 make all |
459 | 38 |
39 %install | |
7424 | 40 rm -rf $RPM_BUILD_ROOT |
11062
a2a6fd1064df
contrib/mercurial.spec: Use DESTDIR variable and 'make install'
Mads Kiilerich <mads@kiilerich.com>
parents:
11014
diff
changeset
|
41 make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_prefix} MANDIR=%{_mandir} |
4753
620cea146b19
mercurial.spec: include CONTRIBUTORS, COPYING and man pages in rpm
Adam Spiers <hg@adamspiers.org>
parents:
4752
diff
changeset
|
42 |
12056
85439f43749f
mercurial.spec: specify file modes for install
Mads Kiilerich <mads@kiilerich.com>
parents:
11845
diff
changeset
|
43 install -m 755 contrib/hgk $RPM_BUILD_ROOT%{_bindir} |
85439f43749f
mercurial.spec: specify file modes for install
Mads Kiilerich <mads@kiilerich.com>
parents:
11845
diff
changeset
|
44 install -m 755 contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir} |
4752
cc0fb3500dd5
mercurial.spec: include various utility files from contrib/ in rpm
Adam Spiers <hg@adamspiers.org>
parents:
4751
diff
changeset
|
45 |
cc0fb3500dd5
mercurial.spec: include various utility files from contrib/ in rpm
Adam Spiers <hg@adamspiers.org>
parents:
4751
diff
changeset
|
46 bash_completion_dir=$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d |
cc0fb3500dd5
mercurial.spec: include various utility files from contrib/ in rpm
Adam Spiers <hg@adamspiers.org>
parents:
4751
diff
changeset
|
47 mkdir -p $bash_completion_dir |
8942
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
48 install -m 644 contrib/bash_completion $bash_completion_dir/mercurial.sh |
4752
cc0fb3500dd5
mercurial.spec: include various utility files from contrib/ in rpm
Adam Spiers <hg@adamspiers.org>
parents:
4751
diff
changeset
|
49 |
cc0fb3500dd5
mercurial.spec: include various utility files from contrib/ in rpm
Adam Spiers <hg@adamspiers.org>
parents:
4751
diff
changeset
|
50 zsh_completion_dir=$RPM_BUILD_ROOT%{_datadir}/zsh/site-functions |
cc0fb3500dd5
mercurial.spec: include various utility files from contrib/ in rpm
Adam Spiers <hg@adamspiers.org>
parents:
4751
diff
changeset
|
51 mkdir -p $zsh_completion_dir |
8942
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
52 install -m 644 contrib/zsh_completion $zsh_completion_dir/_mercurial |
4752
cc0fb3500dd5
mercurial.spec: include various utility files from contrib/ in rpm
Adam Spiers <hg@adamspiers.org>
parents:
4751
diff
changeset
|
53 |
8942
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
54 mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir} |
12056
85439f43749f
mercurial.spec: specify file modes for install
Mads Kiilerich <mads@kiilerich.com>
parents:
11845
diff
changeset
|
55 install -m 644 contrib/mercurial.el $RPM_BUILD_ROOT%{emacs_lispdir} |
85439f43749f
mercurial.spec: specify file modes for install
Mads Kiilerich <mads@kiilerich.com>
parents:
11845
diff
changeset
|
56 install -m 644 contrib/mq.el $RPM_BUILD_ROOT%{emacs_lispdir} |
8942
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
57 |
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
58 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d |
12056
85439f43749f
mercurial.spec: specify file modes for install
Mads Kiilerich <mads@kiilerich.com>
parents:
11845
diff
changeset
|
59 install -m 644 contrib/mergetools.hgrc $RPM_BUILD_ROOT%{_sysconfdir}/mercurial/hgrc.d/mergetools.rc |
459 | 60 |
563 | 61 %clean |
62 rm -rf $RPM_BUILD_ROOT | |
459 | 63 |
563 | 64 %files |
65 %defattr(-,root,root,-) | |
10664
9602fc4e6914
mercurial.spec: remove reference to doc/ja
Greg Lindahl <greg@blekko.com>
parents:
10263
diff
changeset
|
66 %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html *.cgi contrib/*.fcgi |
10255
26fc868cb8b0
mercurial.spec: Alignment with AIX spec by Jim Hague
Mads Kiilerich <mads@kiilerich.com>
parents:
9635
diff
changeset
|
67 %doc %attr(644,root,root) %{_mandir}/man?/hg* |
8942
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
68 %doc %attr(644,root,root) contrib/*.svg contrib/sample.hgrc |
12056
85439f43749f
mercurial.spec: specify file modes for install
Mads Kiilerich <mads@kiilerich.com>
parents:
11845
diff
changeset
|
69 %dir %{_datadir}/zsh/ |
85439f43749f
mercurial.spec: specify file modes for install
Mads Kiilerich <mads@kiilerich.com>
parents:
11845
diff
changeset
|
70 %dir %{_datadir}/zsh/site-functions/ |
4752
cc0fb3500dd5
mercurial.spec: include various utility files from contrib/ in rpm
Adam Spiers <hg@adamspiers.org>
parents:
4751
diff
changeset
|
71 %{_datadir}/zsh/site-functions/_mercurial |
12056
85439f43749f
mercurial.spec: specify file modes for install
Mads Kiilerich <mads@kiilerich.com>
parents:
11845
diff
changeset
|
72 %dir %{_datadir}/emacs/site-lisp/ |
4752
cc0fb3500dd5
mercurial.spec: include various utility files from contrib/ in rpm
Adam Spiers <hg@adamspiers.org>
parents:
4751
diff
changeset
|
73 %{_datadir}/emacs/site-lisp/mercurial.el |
10255
26fc868cb8b0
mercurial.spec: Alignment with AIX spec by Jim Hague
Mads Kiilerich <mads@kiilerich.com>
parents:
9635
diff
changeset
|
74 %{_datadir}/emacs/site-lisp/mq.el |
4752
cc0fb3500dd5
mercurial.spec: include various utility files from contrib/ in rpm
Adam Spiers <hg@adamspiers.org>
parents:
4751
diff
changeset
|
75 %{_bindir}/hg |
cc0fb3500dd5
mercurial.spec: include various utility files from contrib/ in rpm
Adam Spiers <hg@adamspiers.org>
parents:
4751
diff
changeset
|
76 %{_bindir}/hgk |
cc0fb3500dd5
mercurial.spec: include various utility files from contrib/ in rpm
Adam Spiers <hg@adamspiers.org>
parents:
4751
diff
changeset
|
77 %{_bindir}/hg-ssh |
8942
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
78 %dir %{_sysconfdir}/bash_completion.d/ |
12056
85439f43749f
mercurial.spec: specify file modes for install
Mads Kiilerich <mads@kiilerich.com>
parents:
11845
diff
changeset
|
79 %config(noreplace) %{_sysconfdir}/bash_completion.d/mercurial.sh |
8942
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
80 %dir %{_sysconfdir}/mercurial |
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
81 %dir %{_sysconfdir}/mercurial/hgrc.d |
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
82 %config(noreplace) %{_sysconfdir}/mercurial/hgrc.d/mergetools.rc |
8867
ff817723280a
contrib/buildrpm: Support python 2.4 and 2.6
Mads Kiilerich <mads@kiilerich.com>
parents:
7433
diff
changeset
|
83 %if "%{?pythonver}" != "2.4" |
ff817723280a
contrib/buildrpm: Support python 2.4 and 2.6
Mads Kiilerich <mads@kiilerich.com>
parents:
7433
diff
changeset
|
84 %{_libdir}/python%{pythonver}/site-packages/%{name}-*-py%{pythonver}.egg-info |
ff817723280a
contrib/buildrpm: Support python 2.4 and 2.6
Mads Kiilerich <mads@kiilerich.com>
parents:
7433
diff
changeset
|
85 %endif |
8942
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
86 %{_libdir}/python%{pythonver}/site-packages/%{name} |
51038bb526ea
Make RPM spec in contrib more aligned with the one from Fedora
Mads Kiilerich <mads@kiilerich.com>
parents:
8936
diff
changeset
|
87 %{_libdir}/python%{pythonver}/site-packages/hgext |