Commit Graph

120 Commits

Author SHA1 Message Date
Martin Geisler
bdbf775ab7 setup: slight simplification 2010-09-26 21:37:42 +02:00
Renato Cunha
e3f3dfa6c3 setup.py: Add 'mercurial' as include dir for the inotify compiler.
This patch adds access to util.h for the inotify C module by adding the
"mercurial" directory as an include dir, enabling access to the macros defined
in util.h.
2010-07-02 16:21:36 -03:00
Renato Cunha
c1d27d1c4d setup.py: Adjustments to make setup.py run in py3k.
In py3k, subprocess.Popen.communicate's output are bytes objects. String
literals are Unicode objects. Thus, when a bytes object startswith method is
called, with string literals, it fails. What this patch does is:

 * Convert the string (unicode in py3k) literals to bytes objects;
 * As "bytes" is not a builtin in python < 2.6, it defines a "b" helper
 function that merely returns its argument, as suggested by Antoine Pitrou.
2010-07-02 16:21:34 -03:00
Christian Boos
400df6f4a9 setup: ignore failures to build optional inotify extension 2010-06-23 13:44:07 +02:00
Nicolas Dumazet
7f1a963829 pylint, pyflakes: remove unused or duplicate imports 2010-04-14 17:58:10 +09:00
Benoit Boissinot
6180612089 setup.py: don't use tabs 2010-03-24 19:44:30 +01:00
Dirkjan Ochtman
e95cb55390 setup: fail if bz2 is not available 2010-03-23 20:01:30 +01:00
Benoit Boissinot
92607edfec Do not use osutil.c with python 2.4 and Windows (issue1364)
Windows python 2.4 os.stat() reports times including DST offset, while osutil.c
reports the correct value, which makes status() systematically compare files
content. This bug is fixed in python 2.5. Using osutil.py instead of osutil.c
is 4x times slower on large repositories but current code is completely
unusable. Given few people are likely to use python 2.4 on Windows this
solution was considered a good trade-off compared to more invasive solutions
trying to address the offset issue.
2010-02-21 22:16:35 +01:00
Adrian Buehlmann
fb523c41d9 setup.py: fixing version info for Windows hg.exe (py2exe)
Fixes

  warning: py2exe: Version Info will not be included:
    could not parse version number ...

which was seen when doing nightly builds. hg.exe files
of nightly builds did not have any version info resoure,
which may cause problems with installers.

Also setting a copyright string for the version resource
(was missing).
2010-02-07 23:07:58 +01:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
cd3ef170f7 Merge with stable 2010-01-19 22:45:09 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Martin Geisler
577446318e setup.py: keep Python 2.3 compatibility
Though we only support Python 2.4 or greater, we should keep setup.py
compatible with earlier versions on the syntactic level. Otherwise
people will simply get a SyntaxError when trying to install Mercurial
with an old version of Python. With this change, the setup.py file can
be imported with Python 2.3 and we then issue a friendly error message
when we detect that Python is too old.
2009-12-23 19:11:37 +01:00
Steve Borho
e46cd0e296 setup: ignore 'not importing' warnings during version detection
Python will issue an ImportWarning when seeing 'import locale' if
there is a locale/ directory present without a __init__.py file.

The warning is silent by default, but it somehow shows up anyway on
Windows when setup.py executed hg. The warning causes runcmd to panic
since it sees output on stderr.

This patch ignores warnings on stderr about not importing a package.
2009-12-05 14:18:31 -06:00
Christian Boos
2cf6c2ce31 setup: pass LD_LIBRARY_PATH to subprocess when determining version. 2009-11-09 17:41:21 +01:00
Christian Boos
b1a3260e08 setup: fix 3fd9b85b797a refactoring, propagate env to runcmd 2009-11-09 17:33:16 +01:00
Gilles Moris
261967d9c9 setup: refactor the version string to a subset of tag+tagdist-hash+date
Here is an array summarizing the mercurial version string:
      [A]       [B]   [C]           [D]
[1] clone      tag   clean  =>  tag
[2] clone      hash  clean  =>  latesttag+latesttagdistance-hash
[3] clone      tag   dirty  =>  tag+date
[4] clone      hash  dirty  =>  latesttag+latesttagdistance-hash+date
[5] archive    tag   clean  =>  tag
[6] archive    hash  clean  =>  latesttag+latesttagdistance-hash

Column [A]: Mercurial built from an hg *archive* or hg *clone* working directory
Column [B]: revision built has a *tag* or else default to the SHA1 *hash*
Column [C]: working tree *clean* or *dirty*
Column [D]: Mercurial version string

Over the previous version:
- row [5] did return just the node hash, now it returns the tag
- prepend the latest tag and the distance to it to rows [2][4][6]
- append also the date to row [3]; previously, it was just the tag
- the version string is with an empty string to avoid possible TypeError
  exceptions during string manipulations
- factorize the function to run hg commands; remove the error message as it is
  no more specific to the function.

This scheme enables to have first part of the version strings that can be
compared, whether it has been built from a tagged or untagged revision.
The second part of the version adds a hash for untagged revisions and today's
date if the working tree has local modifications.
As the version string does not contain spaces or special characters, it should
not break script parsing the 'hg version' command and should be usable for use
in file names.

The new code also ensure that the version string has exactly the same version
string, whether it has been built from an archive or from a clone.
2009-10-18 14:35:36 +02:00
Martin Geisler
524b665b54 help: move help topics from mercurial/help.py to help/*.txt
The help topics are loaded on demand so we wont hit the disk unless we
really have to.
2009-10-04 09:59:13 +02:00
Martin Geisler
a2bda0adf6 merge with crew-stable 2009-07-15 17:44:47 +02:00
Bryan O'Sullivan
b58896628b Merge with crew-stable 2009-07-14 17:21:10 -07:00
Bryan O'Sullivan
e538c31828 setup.py: don't pollute the current directory with temporary files 2009-07-14 17:18:45 -07:00
James Abbatiello
0d7eb15222 Don't copy hidden files/directories during setup.py install
This is useful if a copy of Mercurial is stored in a Subversion repository
so that the .svn directories don't get copied.
2009-07-14 22:42:05 -04:00
Alejandro Santos
77d606ac51 compat: use open() instead of file() everywhere 2009-07-05 11:01:30 +02:00
Dirkjan Ochtman
1d29e68744 change wiki/bts URLs to point to new hostname 2009-06-24 15:32:37 +02:00
Garth Roxburgh-Kidd
ec8fc1a93b fixed 0xc0150004 error building Mercurial under Python 2.6 for Windows 2009-05-28 17:03:35 +02:00
Martin Geisler
dcc3781fa0 setup: execute hg in C locale 2009-05-26 22:02:10 +02:00
Martin Geisler
350a0986a8 setup: handle trust warnings when determining version 2009-05-26 21:13:21 +02:00
Martin Geisler
27457436c6 setup: renamed l, e vars to out, err 2009-05-26 21:07:41 +02:00
Martin Geisler
da0be36295 Merge with stable 2009-12-23 19:18:03 +01:00
Martin Geisler
3afd6f9898 Merge with stable 2009-12-23 18:40:57 +01:00
Martin Geisler
24f2c1af20 setup: backout 47cfa8aa4b94
We decided that it is better to let the distributions install these
files themselves since they know where to put them.
2009-12-10 22:26:09 +01:00
Dan Villiom Podlaski Christiansen
a6c07a0720 setup: install some useful data files.
The selection is somewhat arbitrary. In the case of the Zsh completion
file, it will not conflict with the builtin Zsh completions: they
are in a file named `_mercurial', not `_hg'.
2009-11-30 21:54:34 +01:00
Martin Geisler
323bad57b9 setup: cleanup coding style 2009-12-03 20:50:00 +01:00
Dan Villiom Podlaski Christiansen
238d382291 setup: install translation files as package data
Remove the `install_package_data' subclass of `install_data' and use
the `package_data' functionality provided by distutils instead. As
package data must be located within the package directory, the data
files are now generated in the build directory.

To simplify the functionality of this change, the top-level `doc' and
`templates' directories have been moved into the `mercurial' package
directory.
2009-12-01 16:06:10 +01:00
Martin Geisler
30977ca6df setup: don't ship i18n directory
The directory was never actually used at runtime and other programs
don't ship it either.
2009-12-03 20:41:43 +01:00
Martin Geisler
a18ac5b4e2 setup: another newline if version could not be established. 2009-05-23 13:43:11 +02:00
Martin Geisler
2634f59be8 setup: add missing newline in warning 2009-05-23 00:24:00 +02:00
Jeremy Whitlock
eae140b922 setup: read .hg_archival.txt for version info (issue1670)
Previously, setup.py was enhanced to identify the Mercurial version
from either .hg/ or mercurial/__version__.py. When archives are
created using 'hg archive' or via hgweb, neither of those options are
available. However, there is a .hg_archival.txt file in the root of
the archive that has the information. This patch enhances setup.py to
identify the Mercurial version from the .hg_archival.txt file when
there is no .hg/ or mercurial/__version__.py available.
2009-05-22 21:03:06 +02:00
Christian Ebert
60c4e3cc03 setup.py: subprocess instead of os.popen, sys.stderr.write instead of print
Also check that .hg is a directory.
2009-05-22 14:26:58 +02:00
Martin Geisler
a100fe0b6c setup: require Python 2.4 2009-05-03 17:36:58 +02:00
Martin Geisler
4c6a32f451 setup: cleanup old left-over code 2009-05-03 00:41:09 +02:00
Jeremy Whitlock
94b6b92b9f Fix how setup.py identifies the Mercurial version.
There is a problem with setup.py where it will not identify the Mercurial
version properly when not being ran in within a repository even if
mercurial/__version__.py exists.

To fix, use mercurial.__version__.version when available before defaulting
to "unknown".  (Using mercurial.util.version() is not an option due to a
dependency issue where osutil can be referenced before it is built.)
2009-04-02 18:18:43 -06:00
Matt Mackall
9c307b1dee setup: remove spurious posix import 2009-04-03 12:37:44 -05:00
Matt Mackall
81073ba20c setup.py: fix version detection for tarball
- don't do version detection if there's no .hg directory
- shrink try: clause
- don't write __version__.py if version is unknown
  (we might overwrite the real version)
2009-03-06 09:15:47 -06:00
Martin Geisler
6c5bf586cb setup: run hg with empty HGRCPATH for robustness.
Otherwise a bad hgrc file can make the version detection fail.
2009-02-24 18:09:16 +01:00
Martin Geisler
a4fae9e3f1 setup: use sys.executable to call hg
Executing ".\hg" does not work on Windows, but we can instead ask
Python to execute hg.
2009-02-18 00:44:38 +01:00
Martin Geisler
bf5d4304c2 add --pure flag to setup.py
This flag will make the build_py step install the pure Python modules
in mercurial/pure/ into mercurial/ and furthermore prevent building
the C extensions.
2009-01-24 01:44:43 +01:00
Martin Geisler
7c52fb0c3f setup: get version number using pure Python modules 2009-01-29 19:25:25 +01:00
Martin Geisler
e7e00ca6f5 setup: do not use -c with msgfmt on Solaris (issue1489) 2009-01-28 10:32:15 +01:00
Martin Geisler
6d35a80a4a i18n: check format strings when building xx.mo files 2009-01-25 20:27:37 +01:00