Commit Graph

220 Commits

Author SHA1 Message Date
Benoit Boissinot
ea7fe6dacc remove unused variables 2008-10-28 19:25:26 +01:00
Dirkjan Ochtman
371218cc63 get rid of semi-colon introduced in 89c0afc2016a 2008-10-18 16:30:50 +02:00
Matt Mackall
4eb3a715b4 dirstate: always add times to map as integers
Fix bug spotted by Dov Feldstern
2008-10-18 04:26:06 -05:00
Petr Kodl
681e2c1a41 Take advantage of fstat calls clustering per directory if OS support it.
util module implements two versions of statfiles function

_statfiles calls lstat per file

_statfiles_clustered takes advantage of optimizations in osutil.c, stats all
files in directory at once when new directory is hit and caches the results

util.statfiles dispatches to appropriate version during module loading

The speedup on directory tree with 2k directories and 63k files is about
factor of 1.8 (1.3s -> 0.8s for hg diff - hg startup overhead about .2s)

At this point only Win32 now benefit from this patch.
Rest of OSes use the non clustered implementation.
2008-10-09 10:29:47 -04:00
Benoit Boissinot
1d33f1c63b dirstate.walk: skip unreadable directories (issue1213)
Do not abort on permission denied error, just skip the directory.
2008-10-15 14:52:27 +02:00
Benoit Boissinot
45680829ac dirstate._dirs: fix refcounting broken by ece124266b74
reported by Patrick Waugh
2008-10-15 01:14:29 +02:00
Matt Mackall
1c5fcf7d0e dirstate: C parsing extension 2008-10-12 15:21:08 -05:00
Petr Kodl
f41fa5275a Eliminate normpath from foldmap calls.
Normcase already takes care of upper/lower case and /->\ conversions.

What's left for normpath is folding of a/../a sequences but this should
be either done consistently on both non-folding and folding code path
or not at all, otherwise we are introducing inconsistent behavior between the
two that has nothing to do with case folding.

Second argument against it - normpath being pure Python function is very slow -
as much as 50% of time is spend just inside normpath call on my repository.
2008-09-30 17:23:08 -04:00
Petr Kodl
6dacfe6beb issue 1286: dirstat regression on case folding systems
This patch fixes regression reported in 1286 that causes util.fspath
to be called for every file not in current manifest - including ignored files.
The regression is quite severe - the time for simple hg st goes from 5s to 1m38s
on one of my source trees - which basically renders mercurial useless.
2008-09-30 17:23:08 -04:00
Matt Mackall
2d47031d0d listdir: add support for aborting if a certain path is found
This lets us bail out early if we find '.hg', letting us skip sorting
and bisecting for it.
2008-09-13 10:46:47 -05:00
Matt Mackall
7ce9a41a12 dirstate: improve performance for building _dirs 2008-09-12 19:57:07 -05:00
Benoit Boissinot
cdffbdce00 dirstate: use the right variable (f, not ff) 2008-09-10 22:54:28 +02:00
Peter Ruibal
30a2036f9e use Exception(args)-style raising consistently (py3k compatibility) 2008-09-08 13:07:00 +02:00
Benoit Boissinot
7f2ac71a6c make normalize() work when cwd != repo.root 2008-09-02 22:04:09 +02:00
Andrei Vermel
4812226d8b Fix normalize fail on non-lowercase filename (Issue1273)
regression introduced in 367ff9c9d221
2008-08-02 19:34:50 +04:00
Benoit Boissinot
882dcf0454 dirstate: explain why appending instead of os.path.join() is safe 2008-09-02 17:32:07 +02:00
Benoit Boissinot
fe44f90406 performance: normalize self._root, avoid calling os.path.join() in dirstate
In dirstate, self._join() might get called a lot. Instead of calling it
we create self._rootdir and we then only need to append the filename.
2008-09-02 15:12:50 +02:00
Benoit Boissinot
a835798d04 performance: do not stat() things when not required
Ignore unknown files if we don't need them (eg in hg diff).
It slows things down a little bit for big trees (kernel repo), since _join()
is called for each file instead of for each directory.

fix issue567
2008-09-02 15:08:26 +02:00
Matt Mackall
ec9023fc53 dirstate.walk: speed up calling match function 2008-07-22 13:03:31 -05:00
Matt Mackall
bc3382c896 dirstate.walk: reduce sorting in step 3 2008-07-22 13:03:29 -05:00
Matt Mackall
4979b90382 dirstate.walk: inline imatch
This lets us carefully avoid calling ignore and match where possible
in the fast path.
2008-07-22 13:03:25 -05:00
Matt Mackall
16c391fd58 dirstate.walk: more cleanups
- group internal functions
- simplify imatch
- rename _join to join
- use nf in step 3
- use .hg in results
2008-07-22 13:03:24 -05:00
Matt Mackall
8e4bbebebc dirstate.walk: fold in _supported
- inline tests for regular or link files
- simplify bad type reporting
2008-07-22 13:03:23 -05:00
Matt Mackall
e008b3db94 dirstate.walk: build a dict rather than yield
Since we're already building a seen dict, we might as well put our
results in it to go slightly faster.
2008-07-22 13:03:21 -05:00
Matt Mackall
4dbb566744 dirstate.walk: minor cleanups
- add dirkind
- simplify loop structure
- avoid pconvert and join on directory entries (big speed bump)
- remove redundant seen set in step 3
2008-07-22 13:03:20 -05:00
Matt Mackall
8cb2b4a288 dirstate.walk: push sorting up 2008-07-22 13:03:19 -05:00
Matt Mackall
c92a459e5d dirstate.walk: pull directory scanning into top-level loop 2008-07-22 13:03:18 -05:00
Matt Mackall
3f15476596 dirstate.walk: unify match.dir logic 2008-07-22 13:03:17 -05:00
Matt Mackall
6149899c06 dirstate.walk: simplify .hg scan bisect logic 2008-07-22 13:03:16 -05:00
Matt Mackall
22a6fcf0d1 dirstate.walk: track normalized directory names 2008-07-22 13:03:15 -05:00
Matt Mackall
6f3a239e30 dirstate: simplify normalize logic 2008-07-22 13:03:14 -05:00
Matt Mackall
dab7588539 dirstate.walk: change names for dc and known
known -> seen
dc -> dmap
2008-07-22 13:03:13 -05:00
Matt Mackall
6b6e7d5723 dirstate.walk: fold findfiles into main walk loop 2008-07-22 13:03:10 -05:00
Matt Mackall
7bc24c8723 dirstate.walk: eliminate filter function
- remove _filter and delete original
- improve some filtering logic
2008-07-22 13:03:08 -05:00
Matt Mackall
9d3da8e0ee dirstate.walk: eliminate src from yield
- restructure 'step two' to stat unseen files
- remove extra stat logic in status
- remove redundant src
2008-07-22 13:02:36 -05:00
Patrick Mezard
90eabcbff1 dirstate: remove superfluous normalize() call in walk() 2008-07-20 19:25:08 +02:00
Patrick Mezard
37536c33c2 dirstate: fix _droppath() typo from be348d0dd417 2008-07-20 19:08:59 +02:00
Matt Mackall
21163fdc2f dirstate: simplify/optimize path checking
- add fast _finddirs function
- remove recursion from incpath/decpath
- split changepath into addpath/droppath
- change relax arg to check
- move incpathcheck logic into addpath
- move incpath into addpath
- move decpath into droppath
- inline code in self._dirs creation
2008-07-11 18:46:02 -05:00
Matt Mackall
a65ef7bc5d util: add sort helper 2008-06-27 18:28:45 -05:00
Matt Mackall
9ae3592d4e dirstate: improve case-folding logic
- return normalized form in directory walk
- track normalized form in known
2008-06-26 15:55:23 -05:00
Matt Mackall
4382d6c797 dirstate: fold statwalk and walk 2008-06-26 14:35:50 -05:00
Matt Mackall
73c76dd164 repo.status: eliminate list_ 2008-06-26 14:35:50 -05:00
Matt Mackall
bc715be859 add __len__ and __iter__ methods to repo and revlog 2008-06-26 14:35:50 -05:00
Matt Mackall
dcacfb3161 manifest: remove execf/linkf methods 2008-06-26 14:35:50 -05:00
Matt Mackall
b2155285a8 rename checkfolding to checkcase 2008-06-26 13:58:24 -05:00
Matt Mackall
be55fba8f6 dirstate: remove unused folding function 2008-06-26 13:58:22 -05:00
Matt Mackall
d462e1fc26 simplify flag handling
add _checklink var to dirstate
introduce dirstate.flagfunc
switch users of util.execfunc/linkfunc to flagfunc
change manifestdict.set to take a flags string
change ctx.fileflags to ctx.flags
change gitmode func to a dict
remove util.execfunc/linkfunc
2008-06-26 13:46:34 -05:00
Patrick Mezard
1fa87a95fd Merge with crew-stable 2008-06-15 13:05:39 +02:00
Patrick Mezard
c7f6f81b90 Ignore dummy copies in dirstate and localrepo.filecommit() 2008-06-15 13:01:03 +02:00
Paul Moore
8eff9bc01c Add a normalize() method to dirstate
This method returns the normalised form of a path. This is
  - the form in the dirstate, if available, or
  - the form on disk, if available, or
  - the form passed on the command line
normalize() is called on the type-'f' result of statwalk.

This fixes issues 910 and 1092
2008-06-06 19:23:29 +01:00