Commit Graph

968 Commits

Author SHA1 Message Date
Augie Fackler
a1cb15c378 util: use iter(callable, sentinel) instead of while True
This is functionally equivalent, but is a little more concise.
2016-08-05 14:00:46 -04:00
Matt Mackall
8b736f8354 date: accept broader range of ISO 8601 time specs
The "normal" ISO date/time includes a T between date and time. It also
allows dropping the colons and seconds from the timespec. Add new
patterns for these forms as well as tests.
2016-07-27 15:22:36 -05:00
Matt Mackall
6976de3bc5 date: parse ISO-style Z and +hh:mm timezone specs 2016-07-27 15:20:34 -05:00
Matt Mackall
6fad3ce25a date: refactor timezone parsing
We want to be able to accept ISO 8601 style timezones that don't
include a space separator, so we change the timezone parsing function
to accept a full date string and return both the offset and the
non-timezone portion.
2016-07-27 15:14:19 -05:00
Gregory Szorc
bf58ef4033 util: better handle '-' in version string (issue5302)
versiontuple() was previously only splitting on '+' and strings
like "3.9-rc" were causing it to misreport the version as
(3, None). By splitting on either '+' or '-' we can handle
our version strings with "-rc" in them.
2016-07-19 10:15:35 -07:00
Gregory Szorc
f5105c6a41 util: implement a deterministic __repr__ on sortdict
`hg debugbundle` is calling repr() on bundle2 part params, which are
now util.sortdict instances. Unfortunately, repr() doesn't appear
to be deterministic for util.sortdict. So, we implement one.

We include the type name because that's the common convention for
__repr__ implementations. Having the type name in `hg debugbundle`
is a bit ugly. But it's a debug command and I don't care enough to
fix it.
2016-07-17 15:10:30 -07:00
Pulkit Goyal
6b3bc52b40 py3: conditionalize BaseHTTPServer, SimpleHTTPServer and CGIHTTPServer import
The BaseHTTPServer, SimpleHTTPServer and CGIHTTPServer has been merged into
http.server in python 3. All of them has been merged as util.httpserver to use
in both python 2 and 3. This patch adds a regex to check-code to warn against
the use of BaseHTTPServer. Moreover this patch also includes updates to lower
part of test-check-py3-compat.t which used to remain unchanged.
2016-07-13 23:38:29 +05:30
Yuya Nishihara
9531323bdb chgserver: extract utility to bind unix domain socket to long path
This is common problem of using sockaddr_un.
2016-05-21 16:52:04 +09:00
Pulkit Goyal
af9d7f66d0 py3: conditionalize httplib import
The httplib library is renamed to http.client in python 3. So the
import is conditionalized and a test is added in check-code to warn
to use util.httplib
2016-06-28 16:01:53 +05:30
Pulkit Goyal
38a359ce5c py3: conditionalize SocketServer import
The SocketServer is renamed to socketserver in python 3
2016-06-27 16:48:54 +05:30
Pulkit Goyal
fdc0861e35 py3: conditionalize xmlrpclib import
The xmlrpclib library is renamed to xmlrpc.client in python 3
2016-06-27 16:37:37 +05:30
Pulkit Goyal
5fcc6a2628 py3: conditionalize the urlparse import
The urlparse library is renamed to urllib.parse in python 3
2016-06-27 16:16:10 +05:30
Martijn Pieters
5b87e45011 atomictempfile: add context manager support
Close the file (moving it in place) on clean context exit, discard when there
has been an exception.
2016-06-23 18:21:25 +01:00
Martijn Pieters
0b92f0a888 atomictempfile: add read to the supported file operations 2016-06-23 18:20:58 +01:00
FUJIWARA Katsunori
d7b7f8358b doc: describe detail about checkambig optional argument
This is followup for patches below, which add checkambig argument to
existing function.

  - 6508a36c1e44
  - ccbeace526ad
  - 936ec05504bf
  - a9a2d0013b68
2016-06-13 05:11:56 +09:00
Augie Fackler
493fe9d7a6 util: drop local aliases for md5, sha1, sha256, and sha512
This used to be needed to paper over hashlib not being in all Pythons
we support, but that's not a problem anymore, so we can simplify
things a little bit.
2016-06-10 00:13:23 -04:00
Pulkit Goyal
5f52c722cf py3: conditionalize cPickle import by adding in util
The cPickle is renamed to _pickle in python3 and this C extension is available
 in pickle which was not included in earlier versions. So imports are conditionalized
 to import cPickle in py2 and pickle in py3. Moreover the use of pickle in py2 is
 switched to cPickle as the C extension is faster. The hack is added in util.py and
the modules import util.pickle
2016-06-04 14:38:00 +05:30
FUJIWARA Katsunori
01b2069695 util: add __ne__ to filestat class for consistency
This is follow up for 41ed93728910, which introduced filestat class.
2016-06-03 00:44:20 +09:00
Gregory Szorc
a3fac9baf7 util: add sha256
Upcoming patches will teach host fingerprint checking to verify
non-SHA1 fingerprints.

Many x509 certificates these days are SHA-256. And modern browsers
often display the SHA-256 fingerprint for certificates. Since
SHA-256 fingerprints are highly visible and easy to obtain, we
want to support them for fingerprint pinning. So add SHA-256
support to util.

I did not add SHA-256 to DIGESTS and DIGESTS_BY_STRENGTH because
this will advertise the algorithm on the wire protocol. I wasn't
sure if that would be appropriate. I'm playing it safe by leaving
it out for now.
2016-05-28 12:57:28 -07:00
FUJIWARA Katsunori
24a3947a41 util: make copyfile avoid ambiguity of file stat if needed
In some cases below, copying from backup is used to restore original
contents of a file. If copying keeps ctime, mtime and size of a file,
restoring is overlooked, and old contents cached before restoring
isn't invalidated as expected.

  - failure of transaction before closing (from '.hg/journal.backup.*')
  - rollback of previous transaction (from '.hg/undo.backup.*')

To avoid such problem, this patch makes copyfile() avoid ambiguity of
file stat, if needed.

Ambiguity check is executed, only if:

  - checkambig=True is specified (not all copying needs ambiguity check), and
  - destination file exists before copying

This patch also adds 'not (copystat and checkambig)' assertion,
because combination of copystat and checkambig is meaningless.

This patch is a part of preparation for "Exact Cache Validation Plan":

    https://www.mercurial-scm.org/wiki/ExactCacheValidationPlan
2016-05-19 00:20:38 +09:00
FUJIWARA Katsunori
0242ba3045 util: make atomictempfile avoid ambiguity of file stat if needed
Ambiguity check is executed at close(), only if:

  - atomictempfile is created with checkambig=True, and
  - target file exists before renaming

This restriction avoids performance decrement by needless examination
of file stat (for example, filelog doesn't need exact cache
validation, even though it uses atomictempfile to write changes out).

See description of filestat class for detail about why the logic in
this patch works as expected.

This patch is a part of preparation for "Exact Cache Validation Plan":

    https://www.mercurial-scm.org/wiki/ExactCacheValidationPlan
2016-05-19 00:20:38 +09:00
FUJIWARA Katsunori
70f0cd3fdd util: add filestat class to detect ambiguity of file stat
Current posix.cachestat implementation might overlook change of a
file, if changing keeps ctime, mtime and size of file. Comparison of
inode number also overlooks changing in such situation, because inode
number is rapidly reused.

Contents of a file cached before changing isn't invalidated as
expected, if change of a file is overlooked for this "ambiguity" of
file stat.

This patch adds filestat class to detect ambiguity of file stat.

This patch is a part of preparation for "Exact Cache Validation Plan":

    https://www.mercurial-scm.org/wiki/ExactCacheValidationPlan
2016-05-19 00:20:37 +09:00
Adam Simpkins
c92a68e75e util: fix race in makedirs()
Update makedirs() to ignore EEXIST in case someone else has already created the
directory in question.  Previously the ensuredirs() function existed, and was
nearly identical to makedirs() except that it fixed this race.  Unfortunately
ensuredirs() was only used in 3 places, and most code uses the racy makedirs()
function.  This fixes makedirs() to be non-racy, and replaces calls to
ensuredirs() with makedirs().

In particular, mercurial.scmutil.origpath() used the racy makedirs() code,
which could cause failures during "hg update" as it tried to create backup
directories.

This does slightly change the behavior of call sites using ensuredirs():
previously ensuredirs() would throw EEXIST if the path existed but was a
regular file instead of a directory.  It did this by explicitly checking
os.path.isdir() after getting EEXIST.  The makedirs() code did not do this and
swallowed all EEXIST errors.  I kept the makedirs() behavior, since it seemed
preferable to avoid the extra stat call in the common case where this directory
already exists.  If the path does happen to be a file, the caller will almost
certainly fail with an ENOTDIR error shortly afterwards anyway.  I checked
the 3 existing call sites of ensuredirs(), and this seems to be the case for
them.
2016-04-26 15:32:59 -07:00
Gregory Szorc
f301293b9d util: put compression code next to each other
ctxmanager was injecting itself between the compression and
decompression code. Let's restore some order.
2016-10-15 17:24:01 -07:00
timeless
109fcbc79e pycompat: switch to util.urlreq/util.urlerr for py3 compat 2016-04-06 23:22:12 +00:00
timeless
7816ecf261 pycompat: add util.urlerr util.urlreq classes for py3 compat
python3 url.request and url.error are mapped as util.urlreq/util.urlerr
python2 equivalents from urllib/urllib2 are mapped according to the py3
hierarchy
2016-04-07 00:05:48 +00:00
Adrian Buehlmann
86883218e1 util: add doctest to datestr() 2016-04-11 19:46:50 +02:00
Florent Gallaire
ecd665adf8 date: fix boundary check of negative integer 2016-04-12 00:30:28 +02:00
timeless
26ef04b4e1 pycompat: add util.stringio to handle py3 divergence
util.stringio = cStringIO.StringIO / io.StringIO
2016-04-06 20:31:31 +00:00
timeless
bf94a35755 util: use __code__ (available since py2.6) 2016-03-29 17:43:23 +00:00
Adrian Buehlmann
0262d50094 util: fix doc for datestr()
timezone parameter was removed with f88c82e9a297
2016-04-08 22:15:06 +02:00
Florent Gallaire
478ac5c37a date: reallow negative timestamp, fix for Windows buggy gmtime() (issue2513)
DVCS are very useful to store various texts (as legislation) written before
Unix epoch. Fri, 13 Dec 1901 is a nice gain over Thu, 01 Jan 1970.
Revert 856a0e92d107 and b47a679b4e83, fix b2228cbaa635. Add tests.
2016-04-08 14:11:03 +02:00
timeless
9bbc2a69f1 pycompat: add empty and queue to handle py3 divergence
While the pycompat module will actually handle divergence, please
access these properties from the util module:
util.queue = Queue.Queue / queue.Queue
util.empty = Queue.Empty / queue.Empty
2016-04-06 20:00:49 +00:00
timeless
4241ed1e2d util: refactor getstackframes 2016-03-11 17:22:04 +00:00
timeless
a762bae068 util: reword debugstacktrace comment 2016-03-11 16:50:14 +00:00
timeless
3502e556ef util: enable getpid to be replaced
This will enable tests to write stable process ids.
2016-02-03 09:11:22 +00:00
Bryan O'Sullivan
506a2494ba util: rename ctxmanager's __call__ method to enter 2016-01-14 09:31:01 -08:00
Bryan O'Sullivan
0393e42ac3 util: simplify file I/O functions using context managers 2016-01-12 14:49:35 -08:00
Bryan O'Sullivan
a6e4850fe2 util: replace file I/O with readfile 2016-01-12 16:16:19 -08:00
Matt Harbison
4fc4388f40 util: adjust hgcmd() to handle frozen Mercurial on OS X
Previously, 'hg serve -d' was trying to exec the bundled python executable,
which failed with:

    Unknown option: --
    usage: python [option] ...
    Try 'python -h'...
    abort: child process failed to start

See the previous patch for details about the content of the various command
variables.  Note that unlike the previous patch here an application bundling
Mercurial could set $HG in the environment to get the correct result, there
isn't anything that a bundling application could do to get the correct result
here.

'hg serve -d' now launches under TortoiseHg, and there is a process listed in
the background, but a client process cannot connect to it for some reason, so
more investigation is needed.
2016-01-10 18:15:39 -05:00
Matt Harbison
c25bbe3998 util: adjust hgexecutable() to handle frozen Mercurial on OS X
sys.executable is "$appbundle/Contents/MacOS/python" when Mercurial is bundled
in a frozen app bundle on OS X, so that isn't appropriate.  It appears that this
was only visible for things launched via util.system(), like external hooks,
where $HG was set wrong.

It appears that Mercurial also uses 'sys.modules['__main__'].__file__' (here)
and 'sys.argv[0]' (in platform.gethgcmd()) to figure out the command to spawn.
In both cases, this points to "$appbundle/Contents/Resources/hg", which invokes
the system python since "/usr/bin/env python" is on the shebang line.  On my
system with a screwed up python install, I get an error importing the os module
if this script is invoked.

We could take the dirname of sys.executable and join 'hg' instead of this if we
want to be paranoid, but py2app boostrap is setting the environment variable
since 0.1.6 (current version is 0.9), so it seems safe and we might as well use
it.
2016-01-10 17:56:08 -05:00
Matt Harbison
38b5ec9395 util: adjust 'datapath' to be correct in a frozen OS X package
Apparently unlike py2exe, py2app copies the Mercurial source tree as-is to a
Contents/Resources subdirectory of an app bundle, and places its binary stub in
Contents/MacOS.  (The Windows install has the 'hgext' and 'mercurial' modules in
'lib/library.zip', while the help and templates subdirectories have been moved
out of the mercurial directory to the root of the installation.  I assume that
the python code living in a zip file is why "py2exe doesn't support __file__".)
Therefore, prior to this change, Mercurial in a frozen app bundle on OS X would
go looking for help *.txt, templates and locale info in Contents/MacOS, where
they don't exist.

There are only a handful of places that test for frozen, and not all of them are
wrong for OS X, so it seems wiser to handle them on a case by case basis, rather
that try to change mainfrozen().  The remaining cases are:

  1) util.hgexecutable() wrongly points to the bundled python executable, and
       affects $HG in util.system() launched processes (e.g. external hooks)
  2) util.hgcmd() wrongly points to the bundled python executable, but it seems
       to only affect 'hg serve -d'
  3) hook._pythonhook() may be OK, since I didn't see anything outrageous when
       printing sys.path from an internal hook.  I'm not sure if this special
       case is needed on OS X though.
  4) sslutil._plainapplepython() is OK, because sys.executable is not
       /usr/bin/python, nor is it in /System/Library/Frameworks
2016-01-10 17:49:01 -05:00
Augie Fackler
68c57ea46e util: don't capture exception with a name since we don't use it
Spotted by pyflakes.
2016-01-13 14:41:10 -05:00
Bryan O'Sullivan
e1c353db12 util: introduce ctxmanager, to avoid nested try/finally blocks
This is similar in spirit to contextlib.nested in Python <= 2.6,
but uses an extra level of indirection to avoid its inability to
clean up if an __enter__ method raises an exception.

Why add this mechanism?  It greatly simplifies scoped resource
management, and lets us eliminate several hundred lines of try/finally
blocks.  In many of these cases the "finally" is separated from the
"try" by hundreds of lines of code, which makes the connection
between resource acquisition and disposal difficult to follow.

(The preferred mechanism would be the "multi-with" syntax of 2.7+,
but Mercurial can't move to 2.7 for a while.)

Intended use:

>>> with ctxmanager(lambda: file('foo'), lambda: file('bar')) as c:
>>>    f1, f2 = c()

This will open both foo and bar when c() is invoked, and will close
both upon exit from the block.  If the attempt to open bar raises
an exception, the block will not be entered - but foo will still
be closed.
2016-01-11 15:25:43 -08:00
Gregory Szorc
0708caa27a util: remove outdated comment about construction overhead
An old implementation of this class (possibly only in my local repo)
allocated nodes in the cache during construction time, making
__init__ slow for large cache capacities. The current implementation
lazily grow the cache size, making this comment wrong.
2016-01-05 20:52:34 -08:00
Eric Sumner
c24dabdde6 lrucachedict: add copy method
This diff implements the standard dict copy() method for lrucachedicts, which
will be used in the pushrebase extension to make a copy of the manifestcache.
2015-12-30 13:10:53 -08:00
Matt Mackall
e9718e4615 merge with stable 2015-12-16 17:40:01 -06:00
Siddharth Agarwal
5544ae6c91 copyfile: add an optional parameter to copy other stat data
Contrary to the comment, I didn't see any evidence that we were copying
atime/mtime at all. This adds a parameter to copyfile to optionally copy it and
other stat data, with the default being to not copy it.

Many systems don't support changing the timestamp of a symlink, but we don't
need that in general anyway -- copystat is mostly useful for editors, most of
which will dereference symlinks anyway.
2015-12-12 11:00:04 -08:00
Gregory Szorc
f72b4b4450 util: reimplement lrucachedict
As part of attempting to more aggressively use the existing
lrucachedict, collections.deque operations were frequently
showing up in profiling output, negating benefits of caching.

Searching the internet seems to tell me that the most efficient
way to implement an LRU cache in Python is to have a dict indexing
the cached entries and then to use a doubly linked list to track
freshness of each entry. So, this patch replaces our existing
lrucachedict with a version using such a pattern.

The recently introduced perflrucachedict command reveals the
following timings for 10,000 operations for the following cache
sizes for the existing cache:

n=4     init=0.004079 gets=0.003632 sets=0.005188 mixed=0.005402
n=8     init=0.004045 gets=0.003998 sets=0.005064 mixed=0.005328
n=16    init=0.004011 gets=0.004496 sets=0.005021 mixed=0.005555
n=32    init=0.004064 gets=0.005611 sets=0.005188 mixed=0.006189
n=64    init=0.003975 gets=0.007684 sets=0.005178 mixed=0.007245
n=128   init=0.004121 gets=0.012005 sets=0.005422 mixed=0.009471
n=256   init=0.004143 gets=0.020295 sets=0.005227 mixed=0.013612
n=512   init=0.004039 gets=0.036703 sets=0.005243 mixed=0.020685
n=1024  init=0.004193 gets=0.068142 sets=0.005251 mixed=0.033064
n=2048  init=0.004070 gets=0.133383 sets=0.005160 mixed=0.050359
n=4096  init=0.004053 gets=0.265194 sets=0.004868 mixed=0.048352
n=8192  init=0.004087 gets=0.542218 sets=0.004562 mixed=0.032753
n=16384 init=0.004106 gets=1.064055 sets=0.004179 mixed=0.020367
n=32768 init=0.004034 gets=2.097620 sets=0.004260 mixed=0.013031
n=65536 init=0.004108 gets=4.106390 sets=0.004268 mixed=0.010191

As the data shows, the existing cache's retrieval performance
diminishes linearly with cache size. (Keep in mind the microbenchmark
is testing 100% cache hit rate.)

The new cache implementation reveals the following:

n=4     init=0.006665 gets=0.006541 sets=0.005733 mixed=0.006876
n=8     init=0.006649 gets=0.006374 sets=0.005663 mixed=0.006899
n=16    init=0.006570 gets=0.006504 sets=0.005799 mixed=0.007057
n=32    init=0.006854 gets=0.006459 sets=0.005747 mixed=0.007034
n=64    init=0.006580 gets=0.006495 sets=0.005740 mixed=0.006992
n=128   init=0.006534 gets=0.006739 sets=0.005648 mixed=0.007124
n=256   init=0.006669 gets=0.006773 sets=0.005824 mixed=0.007151
n=512   init=0.006701 gets=0.007061 sets=0.006042 mixed=0.007372
n=1024  init=0.006641 gets=0.007620 sets=0.006387 mixed=0.007464
n=2048  init=0.006517 gets=0.008598 sets=0.006871 mixed=0.008077
n=4096  init=0.006720 gets=0.010933 sets=0.007854 mixed=0.008663
n=8192  init=0.007383 gets=0.015969 sets=0.010288 mixed=0.008896
n=16384 init=0.006660 gets=0.025447 sets=0.011208 mixed=0.008826
n=32768 init=0.006658 gets=0.044390 sets=0.011192 mixed=0.008943
n=65536 init=0.006836 gets=0.082736 sets=0.011151 mixed=0.008826

Let's go through the results.

The new cache takes longer to construct. ~6.6ms vs ~4.1ms. However,
this is measuring 10,000 __init__ calls, so the difference is
~0.2us/instance. We currently only create lrucachedict for manifest
instances, so this regression is not likely relevant.

The new cache is slightly slower for retrievals for cache sizes
< 1024. It's worth noting that the only existing use of lurcachedict
is in manifest.py and the default cache size is 4. This regression
is worrisome. However, for n=4, the delta is ~2.9s for 10,000 lookups,
or ~0.29us/op. Again, this is a marginal regression and likely not
relevant in the real world. Timing `hg log -p -l 100` for
mozilla-central reveals that cache lookup times are dominated by
decompression and fulltext resolution (even with lz4 manifests).

The new cache is significantly faster for retrievals at larger
capacities. Whereas the old implementation has retrieval performance
linear with cache capacity, the new cache is constant time until much
larger values. And, when it does start to increase significantly, it
is a few magnitudes faster than the current cache.

The new cache does appear to be slower for sets when capacity is large.
However, performance is similar for smaller capacities. Of course,
caches should generally be optimized for retrieval performance because
if a cache is getting more sets than gets, it doesn't really make
sense to cache. If this regression is worrisome, again, taking the
largest regression at n=65536 of ~6.9ms for 10,000 results in a
regression of ~0.68us/op. This is not significant in the grand scheme
of things.

Overall, the new cache is performant at retrievals at much larger
capacity values which makes it a generally more useful cache backend.
While there are regressions, their absolute value is extremely small.
Since we aren't using lrucachedict aggressively today, these
regressions should not be relevant. The improved scalability of
lrucachedict should enable us to more aggressively utilize
lrucachedict for more granular caching (read: higher capacity caches)
in the near future. The impetus for this patch is to establish a cache
of decompressed revlog revisions, notably manifest revisions. And since
delta chains can grow to >10,000 and cache hit rate can be high, the
improved retrieval performance of lrucachedict should be relevant.
2015-12-06 19:04:10 -08:00
Yuya Nishihara
b65525f9c0 util: rename argument of isatty()
In general, "fd" is a file descriptor, but isatty() expects a file object.
We should call it "fp" or "fh".
2015-12-13 18:48:35 +09:00
Gregory Szorc
7b3fa04da1 util: use absolute_import 2015-12-12 23:14:08 -08:00
Gregory Szorc
c63ae89667 util: make hashlib import unconditional
hashlib was added in Python 2.5. As far as I can tell, SHA-512 is always
available in 2.6+. So move the hashlib import to the top of the file and
remove the one-off handling of SHA-512.
2015-12-12 23:30:37 -05:00
Gregory Szorc
11a7cac430 util: add versiontuple() for returning parsed version information
We have similar code in dispatch.py. Another consumer is about to be
created, so establish a generic function in an accessible location.
2015-11-24 14:23:51 -08:00
Gregory Szorc
5f5da12c81 util.datestr: use divmod()
We were computing the quotient and remainder of a division operation
separately. The built-in divmod() function allows us to do this with
a single function call. Do that.
2015-11-14 17:30:10 -08:00
Matt Mackall
ab46ec3b99 util: drop statmtimesec
We've globablly forced stat to return integer times which agrees with
our extension code, so this is no longer needed.

This speeds up status on mozilla-central substantially:

$ hg perfstatus
! wall 0.190179 comb 0.180000 user 0.120000 sys 0.060000 (best of 53)
$ hg perfstatus
! wall 0.275729 comb 0.270000 user 0.210000 sys 0.060000 (best of 36)
2015-11-19 13:15:17 -06:00
Matt Mackall
62d0fc250b util: disable floating point stat times (issue4836)
Alternate fix for this issue which avoids putting extra function calls
and exception handling in the fast path.

For almost all purposes, integer timestamps are preferable to
Mercurial. It stores integer timestamps in the dirstate and would thus
like to avoid doing any float/int comparisons or conversions. We will
continue to have to deal with 1-second granularity on filesystems for
quite some time, so this won't significantly hinder our capabilities.

This has some impact on our file cache validation code in that it
lowers timestamp resolution. But as we still have to deal with
low-resolution filesystems, we're not relying on this anyway.

An alternate approach is to use stat[ST_MTIME], which is guaranteed to
be an integer. But since this support isn't already in our extension,
we can't depend on it being available without adding a hard Python->C
API dependency that's painful for people like yours truly who have
bisect regularly and people without compilers.
2015-11-19 13:21:24 -06:00
Sean Farley
f6841c5b51 util: also catch IndexError
This makes life so, so much easier for hgwatchman, which provides a named tuple
but throws an IndexError instead of a TypeError.
2015-10-13 16:05:30 -07:00
Pierre-Yves David
30913031d4 error: get Abort from 'error' instead of 'util'
The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be
confused about that and gives all the credit to 'util' instead of the
hardworking 'error'. In a spirit of equity, we break the cycle of injustice and
give back to 'error' the respect it deserves. And screw that 'util' poser.

For great justice.
2015-10-08 12:55:45 -07:00
Yuya Nishihara
5715ebc02c util: use tuple accessor to get accurate st_mtime value (issue4836)
Because st.st_mtime is computed as 'sec + 1e-9 * nsec' and double is too narrow
to represent nanoseconds, int(st.st_mtime) can be 'sec + 1'. Therefore, that
value could be different from the one got by osutils.listdir().

This patch fixes the problem by accessing to raw st_mtime by tuple index.

It catches TypeError to fall back to st.st_mtime because our osutil.stat does
not support tuple index. In dirstate.normal(), 'st' is always a Python stat,
but in dirstate.status(), it can be either a Python stat or an osutil.stat.

Thanks to vgatien-baron@janestreet.com for finding the root cause of this
subtle problem.
2015-10-04 22:35:36 +09:00
Yuya Nishihara
ea5724ad42 util: extract stub function to get mtime with second accuracy
This function is trivial but will need a long comment why it can't use
st.st_mtime. See the next patch for details.
2015-10-04 22:25:29 +09:00
Matt Harbison
bb1dafe069 util: extract stringmatcher() from revset
This is used to match against tags, bookmarks, etc in revsets.  It will be used
in a future patch to do the same tag matching in templater.
2015-08-22 22:52:18 -04:00
Gregory Szorc
fd27bc1367 util.chunkbuffer: avoid extra mutations when reading partial chunks
Previously, a read(N) where N was less than the length of the first
available chunk would mutate the deque instance twice and allocate a new
str from the slice of the existing chunk. Profiling drawed my attention
to these as a potential hot spot during changegroup reading.

This patch makes the code more complicated in order to avoid the
aforementioned 3 operations.

On a pre-generated mozilla-central gzip bundle, this series has the
following impact on `hg unbundle` performance on my MacBook Pro:

before: 358.21 real       317.69 user        38.49 sys
after:  301.57 real       262.69 user        37.11 sys
delta:  -56.64 real       -55.00 user        -1.38 sys
2015-10-05 17:36:32 -07:00
Gregory Szorc
c98628be54 util.chunkbuffer: refactor chunk handling logic
This will make the next patch easier to read. It provides no benefit on
its own.
2015-10-05 16:34:47 -07:00
Gregory Szorc
fdf56bc121 util.chunkbuffer: special case reading everything
The new code results in simpler logic within the while loop. It is also
faster since we avoid performing operations on the queue and buf
collections. However, there shouldn't be any super hot loops for this
since the whole point of chunkbuffer is to avoid reading large amounts
of data at once. This does, however, make it easier to optimize
chunkbuffer in a subsequent patch.
2015-10-05 16:28:12 -07:00
Yuya Nishihara
697917e9d9 util.system: compare fileno to see if it needs stdout redirection
Future patches will reopen stdout to be line-buffered, so sys.stdout may
be different object than sys.__stdout__.
2015-10-03 14:57:24 +09:00
Pierre-Yves David
496ebe3ecb changegroup: use a different compression key for BZ in HG10
For "space saving", bundle1 "strip" the first two bytes of the BZ stream since
they always are 'BZ'. So the current code boostrap the uncompressor with 'BZ'.
This hack is impractical in more generic case so we move it in a dedicated
"decompression".
2015-09-23 11:33:30 -07:00
Siddharth Agarwal
209bbcf824 util: avoid mutable default arguments
I almost introduced a bug around this code by accidentally mutating a default
argument. There's no reason for these to exist.
2015-09-22 16:55:18 -07:00
Pierre-Yves David
47af8d73d3 compression: use 'None' for no-compression
This seems more idiomatic and clearer. We still support both None and 'UN' for
now because no user are migrated.
2015-09-15 17:53:28 -07:00
Pierre-Yves David
f052875fa0 changegroup: move all compressions utilities in util
We'll reuse the compression for other things (next target bundle2), so let's
make it more accessible and organised.
2015-09-15 17:35:32 -07:00
timeless@mozdev.org
5569d89fd9 util: capitalize Python in MBTextWrapper._wrap_chunks comment 2015-09-08 15:32:20 -04:00
Yuya Nishihara
7905f93556 util: extract function that parses timezone string
It will be used to parse a timezone argument passed to a template function.
2015-09-01 19:43:14 +09:00
timeless@mozdev.org
52eae47139 spelling: behaviour -> behavior 2015-08-28 10:53:55 -04:00
Siddharth Agarwal
532b96181d util: drop Python 2.4 compat by directly importing md5 and sha1
There's been a fair amount of cruft here over the years, which we can all
just get rid of now.
2015-10-24 15:56:16 -07:00
Pierre-Yves David
2c879590b7 bufferedinputpipe: remove N^2 computation of buffer length (issue4735)
The assumption that dynamically computing the length of the buffer was N^2, but
negligible because fast was False. So we drop the dynamic computation and
manually keep track of the buffer length.
2015-06-26 11:29:50 -07:00
Pierre-Yves David
4d8c7e6435 bufferedinputpipe: remove an outdate comment
This comment is the remains of a intermediate implementation using

  self._buffer += data

This implementation never made it to the repository and we can safely drop the
comment.
2015-06-27 11:51:25 -07:00
Gregory Szorc
5380dea2a7 global: mass rewrite to use modern exception syntax
Python 2.6 introduced the "except type as instance" syntax, replacing
the "except type, instance" syntax that came before. Python 3 dropped
support for the latter syntax. Since we no longer support Python 2.4 or
2.5, we have no need to continue supporting the "except type, instance".

This patch mass rewrites the exception syntax to be Python 2.6+ and
Python 3 compatible.

This patch was produced by running `2to3 -f except -w -n .`.
2015-06-23 22:20:08 -07:00
Pierre-Yves David
6fec33b555 util: add a simple poll utility
We'll use it to detect when a sshpeer have server output to be displayed.

The implementation is super basic because all case support is not the focus of
this series.
2015-05-20 18:00:05 -05:00
Pierre-Yves David
1447d73588 util: introduce a bufferedinputpipe utility
To restore real time server output through ssh, we need to using polling feature
(like select) on the pipes used to communicate with the ssh client. However
we cannot use select alongside python level buffering of these pipe (because we
need to know if the buffer is non-empty before calling select).

However, unbuffered performance are terrible, presumably because the 'readline'
call is issuing 'read(1)' call until it find a '\n'. To work around that we
introduces our own overlay that do buffering by hand, exposing the state of the
buffer to the outside world.

The usage of polling IO will be introduced later in the 'sshpeer' module. All
its logic will be very specific to the way mercurial communicate over ssh and
does not belong to the generic 'util' module.
2015-05-30 23:55:24 -07:00
Pierre-Yves David
e653dac6f9 util: allow to specify buffer size in popen4
We will need unbuffered IO to restore real time output with ssh peer.

Changeset b61b215fcfa8 seems to indicate playing with this value could be
dangerous, but does not indicate why.
2015-05-20 11:29:45 -05:00
Pierre-Yves David
c34d269931 util: drop the 'unpacker' helper
It is not helping anything anymore.
2015-05-18 23:43:36 -05:00
Pierre-Yves David
44c29cf85d MBTextWrapper: drop dedicated __init__ method
It was only there as a compatibility layer with a version of Python which we do
support anymore.
2015-05-18 16:56:04 -05:00
Pierre-Yves David
5af170b397 util: drop the compatibility with Python 2.4 unpacker
Python 2.4 compatibility have packed and sailed.
2015-05-18 16:54:21 -05:00
Augie Fackler
5b25c17d54 util: drop any() and all() polyfills 2015-05-16 14:37:24 -04:00
Martin von Zweigbergk
4127f67694 util: drop alias for collections.deque
Now that util.deque is just an alias for collections.deque, let's just
remove it.
2015-05-16 11:28:04 -07:00
Adrian Buehlmann
db680f7ce8 util: kill Python 2.4 deque.remove hack 2015-05-16 09:03:21 +02:00
Matt Mackall
ef1d6d97be util: use try/except/finally 2015-05-15 09:58:21 -05:00
Siddharth Agarwal
c4e0365d23 util.checkcase: don't abort on broken symlinks
One case where that would happen is while trying to resolve a subrepo, if the
path to the subrepo was actually a broken symlink. This bug was exposed by an
hg-git test.
2015-05-03 12:49:15 -07:00
FUJIWARA Katsunori
d376c990a1 util: add removedirs as platform depending function
According to 6b1369445b7b introducing "windows._removedirs()":

    If a hg repository including working directory is a reparse point
    (directory symlinked or a junction point), then using
    os.removedirs will remove the reparse point erroneously.

"windows._removedirs()" should be used instead of "os.removedirs()" on
Windows.

This patch adds "removedirs" as platform depending function to replace
"os.removedirs()" invocations for portability and safety
2015-04-11 00:47:09 +09:00
Drew Gottlieb
901ac5e726 util: move dirs() and finddirs() from scmutil to util
An upcoming commit requires that match.py be able to call scmutil.dirs(), but
when match.py imports scmutil, a dependency cycle is created. This commit
avoids the cycle by moving dirs() and its related finddirs() function from
scmutil to util, which match.py already depends on.
2015-04-06 14:36:08 -07:00
Siddharth Agarwal
16d94fc24b util: add normcase spec and fallback
These will be used in upcoming patches to efficiently create a dirstate
foldmap.
2015-04-01 00:38:56 -07:00
Augie Fackler
723d5ae42f util: add progress callback support to copyfiles 2015-03-19 10:24:22 -04:00
Yuya Nishihara
3dbf9536f7 sortdict: have update() accept either dict or iterable of key/value pairs
Future patches will make the templater store a sorted dict in the _hybrid object.
sortdict should be constructed from a sorted list.
2015-02-18 22:53:53 +09:00
André Klitzing
350700ad60 util: accept "now, today, yesterday" for dates even the locale is not english
Hi there!

Fixed date names are helpful for automated systems. So it is possible to
use english date parameter even if the underlying system uses another
locale.

We have here a jenkins with build jobs on different slaves that will do
some operations with "dates" parameter. Some systems uses English locale
and some systems uses German locale. So we needed to configure the job to
uses other date names.

As this is really annoying to keep the systems locale in mind for some
operations I looked into util.py. It would be helpful for automated systems
if the "default English" date names would even usable on other
locales.

I attached a simple patch for this.

Best regards
  André Klitzing
2015-02-24 14:12:13 +01:00
Matt Harbison
721f888f2f transaction: really disable hardlink backups (issue4546) 2015-03-02 10:31:22 -05:00
Matt Mackall
055206a473 transaction: disable hardlink backups (issue4546)
Causing troubles, simplest fix.
2015-03-02 00:12:29 -06:00
Wagner Bruna
41a26dac7c messages: quote "hg help" hints consistently 2015-01-17 22:01:14 -02:00
Pierre-Yves David
71304e633e copyfile: allow optional hardlinking
Some code paths use 'copyfiles' (full tree) for a single file to take advantage
of the best-effort-hard-linking parameter. We add similar parameter and logic
to 'copyfile' (single file) for this purpose.

The single file version have the advantage to overwrite the destination file if
it exists.
2015-01-05 12:39:09 -08:00
Matt Mackall
4accabb1fb unpacker: fix missing arg for py2.4 2015-01-14 16:57:00 -08:00
Matt Mackall
f10752833b unpacker: check the right exception type for 2.4 2015-01-13 16:15:02 -08:00
Matt Mackall
2537cb8fbf util: introduce unpacker
This allows taking advantage of Python 2.5+'s struct.Struct, which
provides a slightly faster unpack due to reusing formats. Sadly,
.unpack_from is significantly slower.
2015-01-10 21:18:31 -06:00
Mads Kiilerich
b420dd92b1 spelling: fixes from proofreading of spell checker issues 2014-04-17 22:47:38 +02:00
Pierre-Yves David
a756e8c469 util: add a 'nogc' decorator to disable the garbage collection
Garbage collection behave pathologically when creating a lot of containers. As
we do that more than once it become sensible to have a decorator for it. See
inline documentation for details.
2014-12-04 05:43:40 -08:00
FUJIWARA Katsunori
f60bafa1b3 vfs: add "notindexed" argument to invoke "ensuredir" with it in write mode
This patch uses "False" as default value of "notindexed" argument,
even though "vfs.makedir()" uses "True" for it, because "os.mkdir()"
doesn't set "_FILE_ATTRIBUTE_NOT_CONTENT_INDEXED" attribute to newly
created directories.
2014-11-19 18:35:14 +09:00
Yuya Nishihara
b2ed607f5e util.system: remove unused handling of onerr=ui
In our code, onerr is None or util.Abort.  It smells bad to overload ui and
exception class.
2014-11-08 13:14:19 +09:00
Sean Farley
93b998c77a sortdict: add insert method
Future patches will allow extensions to choose which order a namespace should
output in the log, so we add a way for sortdict to insert to a specific
location.
2014-10-15 12:39:19 -07:00
Sean Farley
8ea5f6192f sortdict: add iteritems method
Future patches will start using sortdict for log operations where order is
important. Adding iteritems removes the headache of having to remember to use
items() if the object is a sortdict.
2014-11-09 13:15:28 -08:00
Mads Kiilerich
523c87c1fe spelling: fixes from proofreading of spell checker issues 2014-04-17 22:47:38 +02:00
Siddharth Agarwal
c9db5b4295 util.fspath: use a dict rather than a linear scan for lookups
Previously, we'd scan through the entire directory listing looking for a
normalized match.  This is O(N) in the number of files in the directory. If we
decide to call util.fspath on each file in it, the overall complexity works out
to O(N^2). This becomes a problem with directories a few thousand files or
larger.

Switch to using a dictionary instead. There is a slightly higher upfront cost
to pay, but for cases like the above this is amortized O(1). Plus there is a
lower constant factor because generator comprehensions are faster than for
loops, so overall it works out to be a very small loss in performance for 1
file, and a huge gain when there's more.

For a large repo with around 200k files in it on a case-insensitive file
system, for a large directory with over 30,000 files in it, the following
command was tested:

ls | shuf -n $COUNT | xargs hg status

This command leads to util.fspath being called on $COUNT files in the
directory.

COUNT  before  after
    1   0.77s  0.78s
  100   1.42s  0.80s
 1000    6.3s  0.96s

I also tested with COUNT=10000, but before took too long so I gave up.
2014-10-24 11:39:39 -07:00
Wagner Bruna
779ceca4ff i18n: add hint to digest mismatch message 2014-10-23 12:35:10 -02:00
Yuya Nishihara
e7ee70da05 util.system: avoid buffering of subprocess output when it is piped
util.system() copies subprocess' output through pipe if output file is not
stdout.  Because a file iterator has internal buffering, output won't be
flushed until enough data is available.  Therefore, it could easily miss
important messages such as "waiting for lock".
2014-08-30 17:38:14 +02:00
Mike Hommey
d2b17ca844 util: add a file handle wrapper class that does hash digest validation
It is going to be used for the remote-changegroup feature in bundle2.
2014-10-16 17:03:21 +09:00
Mike Hommey
6acd9847bf util: add a helper class to compute digests
It is going to be used for the remote-changegroup feature in bundle2.
2014-10-16 17:02:51 +09:00
Mike Hommey
9741dad0cc util: move md5 back next to sha1 and allow to call it without an argument
This effectively backs out changeset 7582042d6cce.

The API change is done so that both util.sha1 and util.md5 can be called the
same way. The function is moved in order to use it for md5 checksumming for
an upcoming bundle2 feature.
2014-09-24 16:00:47 +09:00
Pierre-Yves David
60ead8ca90 util: fix sorteddict.pop
When using `.pop` on such object the list was not cleared of the popped key,
leading to crash.
2014-10-02 12:39:37 -05:00
Mads Kiilerich
e49fb83975 i18n: use datapath for i18n like for templates and help
To avoid circular module dependencies we initialize i18n from util when
datapath is found.
2014-09-28 16:57:47 +02:00
Mads Kiilerich
e9c0145df2 util: introduce datapath for getting the location of supporting data files
templates, help and locale data is normally stored as sub folders in the
directory containing the source of the mercurial module. In a frozen build they
live as sub folders next to 'hg.exe' and 'library.zip'.

These different kind of data were handled in different ways. Unify that by
introducing util.datapath. The value is computed from the environment and is
always used, so we just calculate the value on module load.
2014-09-28 16:57:06 +02:00
Mads Kiilerich
9b9c077bd6 util: move _hgexecutable a few lines, closer to where it is used 2014-09-28 16:57:06 +02:00
Gregory Szorc
db57d5e9d6 platform: implement readpipe()
Reading all available data from a pipe has a platform-dependent
implementation.

This patch establishes platform.readpipe() by copying the
inline implementation in sshpeer.readerr(). The implementations
for POSIX and Windows are currently identical. The POSIX
implementation will be changed in a subsequent patch.
2014-08-15 20:02:18 -07:00
Siddharth Agarwal
2b459094e1 util.re: add an escape method
The escape method in at least one of the modules called 're2' is in C. This
means it is significantly faster than the Python code written in 're'.

An upcoming patch will have benchmarks.
2014-07-15 15:14:45 -07:00
Siddharth Agarwal
dd9e1b721a util.re: move check for re2 into a separate method
We're going to use the same check for another method in an upcoming patch.
2014-07-15 15:01:52 -07:00
Siddharth Agarwal
fe4e13633a util: remove no longer used compilere 2014-07-15 14:52:40 -07:00
Siddharth Agarwal
d0cd5cb8c7 util: move compilere to a class
We do this to allow us to use descriptors for other related methods.

For now, util.compilere does the same thing. Upcoming patches will remove it.
2014-07-15 14:40:43 -07:00
Siddharth Agarwal
04ca7a05ee util: rename 're' to 'remod'
Upcoming patches will introduce a binding called 're'.
2014-07-15 14:35:19 -07:00
FUJIWARA Katsunori
5206a6fd25 util: replace 'ellipsis' implementation by 'encoding.trim'
Before this patch, 'util.ellipsis' tried to avoid splitting at
intermediate multi-byte sequence, but its implementation was incorrect.

Internal function '_ellipsis' trims specified unicode sequence not at
most maxlength 'columns in display', but at most maxlength number of
'unicode characters'.

    def _ellipsis(text, maxlength):
        if len(text) <= maxlength:
            return text, False
        else:
            return "%s..." % (text[:maxlength - 3]), True

In many encodings, number of unicode characters can be different from
columns in display.

This patch replaces 'ellipsis' implementation by 'encoding.trim',
which can trim string at most maxlength columns in display correctly,
even though specified string contains multi-byte characters.

'_ellipsis' is removed in this patch, because it is referred only from
'ellipsis'.
2014-07-06 02:56:41 +09:00
Angel Ezquerra
74f8eca049 config: move config.sortdict class into util
This makes it more natural to use the sortdict class from outside config.py.
2014-02-23 01:56:31 +01:00
FUJIWARA Katsunori
18631f0006 util: enable "hooks" to return list of the values returned from each hooks 2014-04-16 00:37:24 +09:00
Pierre-Yves David
a04ebd710a util: support None size in chunkbuffer.read()
When no size is provided, read the whole buffer. This aligns with the usual
behavior of `read()` in python.
2014-04-10 22:10:26 -07:00
FUJIWARA Katsunori
accc1366a9 util: add the code path to "cachefunc()" for the function taking no arguments
Before this patch, "util.cachefunc()" caches the value returned by the
specified function into dictionary "cache", even if the specified
function takes no arguments.

In such case, "cache" has at most one entry, and distinction between
entries in "cache" is meaningless.

This patch adds the code path to "cachefunc()" for the function taking
no arguments for efficiency: to store only one cached value, using
list "cache" is a little faster than using dictionary "cache".
2014-02-15 19:52:26 +09:00
Augie Fackler
483cc1f586 util: move from dict() construction to {} literals
The latter are both faster and more consistent across Python 2 and 3.
2014-03-12 13:19:20 -04:00
Mads Kiilerich
877ecd2425 util: debugstacktrace, flush before and after writing
Close another stream (default stdout, which often is buffered) before writing
to the primary stream (default stderr, which often is unbuffered). The primary
stream is also flushed after writing (in case it is buffered).

This fixes non-deterministic output order, especially on windows.
2014-02-20 02:38:36 +01:00
Siddharth Agarwal
22a22b291a util.url: add an 'islocal' method
This returns True if the URL represents a path that can be opened locally,
without needing to go through the entire URL open mechanism.
2014-02-03 14:47:41 -08:00
Mads Kiilerich
771c21f193 util: introduce util.debugstacktrace for showing a stack trace without crashing
This is often very handy when hacking/debugging.

Calling util.debugstacktrace('hey') from a place in hg will give something like:
  hey at:
   ./hg:38                                     in <module>
   /home/user/hgsrc/mercurial/dispatch.py:28   in run
   /home/user/hgsrc/mercurial/dispatch.py:65   in dispatch
   /home/user/hgsrc/mercurial/dispatch.py:88   in _runcatch
   /home/user/hgsrc/mercurial/dispatch.py:740  in _dispatch
   /home/user/hgsrc/mercurial/dispatch.py:514  in runcommand
   /home/user/hgsrc/mercurial/dispatch.py:830  in _runcommand
   /home/user/hgsrc/mercurial/dispatch.py:801  in checkargs
   /home/user/hgsrc/mercurial/dispatch.py:737  in <lambda>
   /home/user/hgsrc/mercurial/util.py:472      in check
...
2014-01-12 23:28:21 +01:00
Christian Ebert
a9aa17b61c util: remove unused realpath (issue4063)
util.realpath was in use for only 5 days from 17bc9a6bb165
until it was backed out in e60acde24a62 because it caused
issue3077 and issue3071.
2013-12-29 13:54:04 +00:00
Matt Mackall
05fd1f2542 merge with stable 2013-11-25 16:15:44 -06:00
Simon Heimberg
2143905ef7 util: url keeps backslash in paths
Backslashes (\) in paths were encoded to %C5 when converting from url to
string. This does not look nice for windows paths. And it introduces many
problems when running tests on windows.
2013-11-20 22:03:15 +01:00
Mads Kiilerich
32fefa2839 util: warn when adding paths ending with \
Paths ending with \ will fail the verification introduced in 0bc0c17d663e when
checking out on Windows ... and if it didn't fail it would probably not do what
the user expected.
2013-11-08 12:35:50 +01:00
Augie Fackler
9f876f6c89 cleanup: move stdlib imports to their own import statement
There are a few warnings still produced by my import checker, but
those are false positives produced by modules that share a name with
stdlib modules.
2013-11-06 16:48:06 -05:00
Matt Mackall
0ed8797e8c merge with stable 2013-11-16 12:44:28 -05:00
Matt Mackall
6e88e21cca date: allow %z in format (issue4040) 2013-11-07 15:24:23 -06:00
Mads Kiilerich
eabc047878 spelling: random spell checker fixes 2013-10-24 01:49:56 +08:00
Matt Mackall
7b8a7d221c merge with stable 2013-10-01 17:00:03 -07:00
Pierre-Yves David
a411302ece repoview: make propertycache.setcache compatible with repoview
Propertycache used standard attribute assignment. In the repoview case, this
assignment was forwarded to the unfiltered repo. This result in:
(1) unfiltered repo got a potentially wrong cache value,
(2) repoview never reused the cached value.

This patch replaces the standard attribute assignment by an assignment to
`objc.__dict__` which will bypass the `repoview.__setattr__`. This will not
affects other `propertycache` users and it is actually closer to the semantic we
need.

The interaction of `propertycache` and `repoview` are now tested in a python
test file.
2013-09-30 14:36:11 +02:00
Jeff Sickel
c1824b83d9 plan9: update util.py for cpython 2.7 build 2013-09-13 15:40:04 -05:00
Siddharth Agarwal
26051a2eee lrucachedict: implement clear() 2013-09-06 13:16:21 -07:00
Simon Heimberg
bbed227d30 util: check if re2 works before using it (issue 3964) 2013-07-01 06:50:58 +02:00
Bryan O'Sullivan
101b24f17b util: add an optional timestamp parameter to makedate
This will be used by the upcoming shelve extension.
2013-06-03 17:20:45 -07:00
Bryan O'Sullivan
4143ebfdee util: rename ct variable in makedate to timestamp 2013-06-03 17:20:44 -07:00
Bryan O'Sullivan
5acd0ede31 summary: augment output with info from extensions 2013-05-14 11:23:15 -07:00
Bryan O'Sullivan
502e5bc1d1 util: migrate fileset._sizetoint to util.sizetoint
The size counting code introduced in 233431858f4c duplicated existing
(but unknown-to-me) code in fileset, so prepare to eliminate the
duplication.
2013-05-14 15:16:43 -07:00
Angel Ezquerra
19a754cb08 util: add notindexed optional parameter to makedirs function 2013-02-16 11:44:13 +01:00