Commit Graph

483 Commits

Author SHA1 Message Date
Dirkjan Ochtman
12c5890a70 kill trailing whitespace 2009-11-05 10:44:36 +01:00
Nicolas Dumazet
3f248fed39 util: use sys.argv[0] if $HG is unset and 'hg' is not in PATH
This is necessary when the executable name is not 'hg'. For example,
if your system-wide mercurial is name 'hgs', sys.argv[0] is more
accurate than 'hg'.
2009-09-21 19:21:32 +02:00
Alexander Solovyov
32999e4659 make path expanding more consistent
This expands ~user and $FOO constructs in ui.ignore files, [defaults],
[paths], extension paths, and HGRCPATH files.
2009-10-19 22:19:28 +03:00
Matt Mackall
20668220a1 Merge with -stable 2009-10-08 00:59:46 -05:00
Matt Mackall
daf9754427 Merge with -crew-stable 2009-10-07 23:25:41 -05:00
Adrian Buehlmann
db3cee7306 util: move rename into posix.py and windows.py 2009-10-07 20:32:07 +02:00
Adrian Buehlmann
d2944ad3db util: state docstring of rename more precisely 2009-10-07 20:16:43 +02:00
Adrian Buehlmann
692aa6b826 util.rename: do not abort if os.unlink fails (issue1840) 2009-10-06 10:45:23 +02:00
Steve Borho
7ec5773565 Merge with crew-stable 2009-10-06 16:08:38 -05:00
Matt Mackall
721ca9098c Fix for issue1848 2009-10-03 15:57:48 -05:00
Mads Kiilerich
097282895a util.system: Use subprocess instead of os.system
subprocess allows the environment and working directory to be specified
directly, so the hacks for making temporary changes while forking is no longer
necessary.

This also fixes failures on solaris where the temporary changes can't be undone
because there is no unsetenv.
2009-09-20 22:19:18 +02:00
Matt Mackall
3e6199cea0 Merge with -stable 2009-09-30 21:42:51 -05:00
Martin Geisler
3e05f2c2a8 ui: guard against UnicodeDecodeErrors in ui.wrap 2009-09-29 01:08:18 +02:00
Martin Geisler
72cc7c5356 util: do not corrupt multi-byte characters in wrap 2009-09-27 01:44:46 +02:00
Martin Geisler
42c594dc7e Merge with crew-stable 2009-09-27 09:38:53 +02:00
Martin Geisler
298efc8d54 util, minirst: do not crash with COLUMNS=0 2009-09-03 21:07:06 +02:00
Carey Evans
28b2e6acc5 util: Fix date format for 12-hour time. 2009-08-21 21:52:57 +12:00
Simon Heimberg
ffdea59f2d util: quicker fspath, do not lower names when the length is different 2009-07-29 14:21:18 +02:00
Nicolas Dumazet
6adbb3c99f util: canonpath: simplify logic
if root == os.sep, then endswithsep(root) is True as well: one test is enough
2009-08-22 15:47:03 +02:00
Patrick Mezard
a1609c7698 Merge with crew-stable 2009-08-23 13:03:10 +02:00
Matt Mackall
e3dc8aa6db fix memory usage of revlog caches by limiting cache size [issue1639] 2009-07-09 17:10:07 -05:00
Martin Geisler
2f4412b3b9 util: remove unused bufsize argument
Removed it correctly this time: the subprocess default is 0, not -1
and so we must pass -1 explicitly. Added a comment to that effect.
2009-07-09 11:59:18 +02:00
Bryan O'Sullivan
6ba3698e94 Merge backed out change 2009-07-08 17:03:16 -07:00
Bryan O'Sullivan
b467399b6f Backed out changeset 6a565336bae3: it caused a 5x performance regression on OS X 2009-07-08 17:01:18 -07:00
Martin Geisler
607267cbbc util: wrap at termwidth-2 by default 2009-07-16 23:25:25 +02:00
Simon Heimberg
4ba52122d6 util: use propertycache in opener instead of __getattr__ 2009-07-10 17:54:04 +02:00
Matt Mackall
eb6cba34d7 Merge with stable 2009-07-09 19:49:02 -05:00
Martin Geisler
a94a165c74 merge with crew-stable 2009-07-09 11:59:56 +02:00
Bryan O'Sullivan
c5ab2a3c14 Merge OS X performance regression fix 2009-07-08 17:03:50 -07:00
Alejandro Santos
3183e52503 compat: use // for integer division 2009-07-05 11:00:44 +02:00
Martin Geisler
a9670d9567 util: remove unused bufsize argument in popen[23] 2009-05-09 17:34:11 +02:00
Martin Geisler
e8bc5f4f01 util: remove ignored mode argument in popen[23] 2009-05-09 17:32:57 +02:00
Martin Geisler
1454ed1684 commands: wrap short descriptions in 'hg help'
The code for wrapping a single line of text with a hanging indent was
duplicated in commands and help -- it's now moved to a new function
called wrap in util.

The function defaults to a line width is 78 chars, and this un-wraps
some command line flag descriptions, hence the test output changes.
2009-06-24 19:15:58 +02:00
Benoit Boissinot
62eea686e0 atomictempfile: fix exception in __del__ if mktempcopy fails (self._fp is None)
Make what is going on more obvious by explicitely getting the 'closed'
attribute from _fp, instead of from the gettatr proxy.
2009-06-13 13:14:02 +02:00
Benoit Boissinot
125a85ec87 use new style classes 2009-06-10 15:10:21 +02:00
Martin Geisler
d8ad0f17b4 util: simplify range expression
The n index variable was unused. Every iteration would pop one element
off of parts, so the for loop can be replaced with a while loop.
2009-05-26 22:37:26 +02:00
Matt Mackall
a30eb02911 cmdutils: Take over glob expansion duties from util 2009-05-24 16:38:29 -05:00
Matt Mackall
f1f37a33cf match: move util match functions over 2009-05-24 02:56:14 -05:00
Matt Mackall
2658db5c8c util: privatize globre 2009-05-24 02:56:14 -05:00
Matt Mackall
b287cf72fe match: refactor patkind
add patkind(pat) to match
change external users
change util.patkind to _patsplit
2009-05-24 02:56:14 -05:00
Matt Mackall
532c58d931 match: change all users of util.matcher to match.match 2009-05-24 02:56:14 -05:00
Martin Geisler
5b0900d7be util: use "is" for True/False/None comparisons 2009-05-20 10:50:23 +02:00
Simon Heimberg
e859b5a899 util: use set instead of dict 2009-05-19 09:57:06 +02:00
Bryan O'Sullivan
496cd5e84c util: make atomictempfile saner if mktempcopy fails 2009-05-14 14:12:32 -07:00
Peter Arrenbrecht
a75765cf7f drop unused imports 2009-05-14 15:35:46 +02:00
Bryan O'Sullivan
ff0948b137 util.termwidth: a file-like object may legitimately lack a fileno() method
Spotted in the wild when running a hook while pushing over HTTPS.
2009-05-11 11:53:27 -07:00
Bryan O'Sullivan
64e91f0ca1 atomictempfile: delegate to posixfile instead of inheriting from it 2009-03-26 13:12:11 -07:00
Simon Heimberg
09ac1e6c92 separate import lines from mercurial and general python modules 2009-04-28 17:40:46 +02:00
Simon Heimberg
f29f0db784 util: overwrite sha1 and _fastsha1 2009-05-08 09:59:15 +02:00
Martin Geisler
97b9a7a062 util: simplify pipefilter and avoid subprocess race
The subprocess module is not thread safe. Spawning a thread to read
the output leads to exceptions like this when Mercurial exits:

  Exception exceptions.TypeError: TypeError("'NoneType' object is not
  callable",) in <bound method Popen.__del__ of <subprocess.Popen
  object at 0x9ed0dcc>> ignored

The bug is already reported in the Python bug tracker:

  http://bugs.python.org/issue1731717
2009-05-07 01:33:44 +02:00