Commit Graph

36 Commits

Author SHA1 Message Date
mcmillen@cs.cmu.edu
dc6517d798 Implementation of per-user .hgignore.
Reference: http://www.selenic.com/mercurial/bts/issue166

If the [ui] section of .hgrc contains keys like "ignore" or
"ignore.something", the values corresponding to these keys are
treated as per-user hgignore files. These hgignore files apply to all
repositories used by that user.
2006-03-24 20:18:02 +01:00
Benoit Boissinot
b04984b4a2 only write the dirstate when something changed 2006-02-23 02:17:08 +01:00
Benoit Boissinot
aa994e6598 add 'debugrebuildstate' to rebuild the dirstate from a given revision
- added and removed files will be lost while recreating the dirstate
- modifications are not lost
2006-02-20 19:04:56 +01:00
Benoit Boissinot
9ea87984bc fix warnings from pychecker (unused variables and shadowing) 2006-02-19 19:43:03 +01:00
Thomas Arendsen Hein
ac4248da86 Make localrepo.changes() internally distinguish between removed and deleted. 2006-01-12 12:22:28 +01:00
Vadim Gelfer
859b47ca42 if hgignore contains errors, print message that is not confusing. 2006-01-02 15:48:16 -08:00
Benoit Boissinot
c6b2943998 Re: [PATCH 2 of 3] remove walk warning about nonexistent files
On 11/15/05, Robin Farine <robin.farine@terminus.org> wrote:
> # HG changeset patch
> # User Robin Farine <robin.farine@terminus.org>
> # Node ID ce0a3cc309a8d1e81278ec01a3c61fbb99c691f4
> # Parent  feb77e0951e74d75c213e8471f107fdcc124c876
> remove walk warning about nonexistent files
>
> diff -r feb77e0951e7 -r ce0a3cc309a8 mercurial/dirstate.py
> --- a/mercurial/dirstate.py     Tue Nov 15 08:42:45 2005 +0100
> +++ b/mercurial/dirstate.py     Tue Nov 15 08:59:50 2005 +0100
> @@ -336,9 +336,6 @@
>              try:
>                  st = os.lstat(f)
>              except OSError, inst:
> -                if ff not in dc: self.ui.warn('%s: %s\n' % (
> -                    util.pathto(self.getcwd(), ff),
> -                    inst.strerror))
>                  continue
>              if stat.S_ISDIR(st.st_mode):
>                  cmp1 = (lambda x, y: cmp(x[1], y[1]))

this break some tests,
a better fix would be to check if ff can be a directory prefix from files in dc

you can try the attached patch.

Benoit
2005-12-01 10:48:29 -06:00
Christian Boos
b837e9f668 Fix walkhelper on windows.
The ''seen'' dictionary stores paths in canonical form,
so the walkhelp must also provide paths in that form,
otherwise the changed files are listed twice.
2005-12-01 10:48:18 -06:00
Eric Hopper
dd6718fc31 Convert all classes to new-style classes by deriving them from object. 2005-11-18 22:48:47 -08:00
twaldmann@thinkmo.de
55d74a6b77 fixed some stuff pychecker shows, marked unclear/wrong stuff with XXX 2005-11-14 03:59:35 +02:00
Benoit Boissinot
0406904c8d add dirstate.lazyread, write atomically the dirstate
- add a dirstate.lazyread function that read only if it wasn't read before and
  update all callers
- use the atomic keyword from util.opener to atomically write the dirstate
mercurial/dirstate.py
2005-11-11 15:34:06 -08:00
Benoit Boissinot
0bb141c937 don't print anything about file of unsupported type unless
the file was specified on the command line
2005-11-11 15:33:08 -08:00
Benoit Boissinot
b39fbd5ced use self.{w,}join when possible 2005-11-08 10:34:50 -08:00
Benoit Boissinot
9db56d4cdb fix a bug in dirstate.changes when cwd != repo.root
- use lstat instead of stat
- add a testcase (thanks to Johannes Hofmann)
2005-11-02 16:13:41 -08:00
Benoit Boissinot
02edb6c65e only files in normal state should be marked as deleted
fix a traceback when you removed an added file
2005-11-02 16:08:48 -08:00
Benoit Boissinot
0bbf5d2b87 fix handling of files of unsupported type in the walk code
if a file was of unsupported type, it was considered as 'seen' while
walking. this way it was possible to have file in the dirstate not
yielded by the walk function.
2005-11-02 15:46:31 -08:00
Benoit Boissinot
64b4619845 fix dirstate.change: it should walk ignored files 2005-10-28 10:57:40 -07:00
Benoit Boissinot
1a6aabcbb0 rewrote changes function in dirstate to use generic walk code
now, file with unsupported type will not show up in status anymore
2005-10-27 13:29:35 -07:00
Benoit Boissinot
06e39e559b i18n part2: use '_' for all strings who are part of the user interface 2005-10-18 18:38:39 -07:00
Benoit Boissinot
e38e94088a i18n first part: make '_' available for files who need it 2005-10-18 18:37:48 -07:00
Benoit Boissinot
809d7cd761 check if a file is ignored before complaining if it is an unsupported type 2005-10-18 00:45:27 -07:00
Matt Mackall
3806a62caf dirstate: make sure we read the dirstate before setting parents 2005-10-18 00:43:19 -07:00
Benoit Boissinot
027c44564c add a check for filetype when walking 2005-10-15 15:43:40 -07:00
Bryan O'Sullivan
1e033a9907 Fix dirstate.changes for ignored directories.
Do a second walking pass to examine any leftover files in the dirstate
map that are in the .hgignore file but match our search criteria.
This fixes the case of entire directories never being examined due to
their presence in the .hgignore file, and should hopefully not add any
significant overhead.
2005-09-18 15:03:07 -07:00
Bryan O'Sullivan
9fd20230a1 Fix ignore regression.
An empty or non-existent hgignore file must return False (don't
ignore) for everything.
2005-09-17 00:37:14 -07:00
Bryan O'Sullivan
ae02dc4df3 Switch to new syntax for .hgignore files.
Here is the new syntax, in summary.
Trailing white space is dropped.
The escape character is "\".
Comments start with #.
Empty lines are skipped.
Lines can be of the following formats:
syntax: regexp # defaults following lines to non-rooted regexps
syntax: glob   # defaults following lines to non-rooted globs
re:pattern     # non-rooted regular expression
glob:pattern   # non-rooted glob
pattern        # pattern of the current default type
The default pattern type is regexp, which is completely backwards
compatible with the old hgignore syntax.
In the dirstate class, the ignore method has been reworked to be based
on the util.matcher function, by way of a new dirstate.hgignore
method.
2005-09-17 00:27:27 -07:00
Bryan O'Sullivan
1ccdac3a1b Fix performance of dirstate.changes with ignored directories. 2005-09-17 00:23:19 -07:00
Chris Mason
329f781b37 Files not getting added appropiately
On Wed, 14 Sep 2005 15:15:13 -0400
Daniel Santa Cruz <byteshack@gmail.com> wrote:

> c:> hg debugstate
> a 666          0 09/14/05 15:11:44 a/aa\aa.a
> a 666          0 09/14/05 15:11:47 a/aa\aa.b  <---- notice mixed
> slashes
>
> This all seems very confusing....

Please try this:
2005-09-14 15:50:31 -05:00
mpm@selenic.com
e271f138e7 dirstate: two more stat -> lstat changes 2005-09-09 12:17:51 -07:00
mpm@selenic.com
9580bfb453 Fix dangling symlink bug in dirstate walk code 2005-09-09 11:46:35 -07:00
mpm@selenic.com
3e01e32fbe Fix Windows status problem from new dirstate walk code 2005-09-08 15:01:33 -07:00
mason@suse.com
e8acfdbc0a Optimize dirstate walking
This generally cuts the time for hg status/diff in half, from 2s down to 1s.
The main parts I'm trying to optimize are:

1) os.walk stats every file.  dirstate.changes then stats every file again.

2) os.walk yields every file and subdir to dirstate.traverse who yields every
file and everything in the dirstate map.  dirstate.walk then
filters this mass and yields every file to the caller.  There should be
fewer steps in here, and fewer duplicate strings yielded.

3) dirstate.walk runs util.unique on the results from dirstate.traverse,
even though it is also passing things through dirstate.seen to look for
duplicates.

I've turned os.walk into something hg specific that takes all the dirstate
ignore and matching rules into account.  The new function also takes an
function arg (statmatch()) the caller supplies to help filter out
files it doesn't care about.  dirstate.changes uses this to update state
for each file, avoiding the second stat call.

dirstate.walk is changed to turn the match function it is passed into
a statmatch function.  The only real difference is that a statmatch
function takes the stat data as a second parameter.  It now calls
dirstate.walkhelper, who requires a statmatch function to be passed.

This fails test-walk, but right now I think this is from a sorting error
fixed by this patch.

Index: crew/mercurial/dirstate.py
===================================================================
2005-09-01 07:34:53 -07:00
mpm@selenic.com
7f0689647a fix some rename/copy bugs
- delete copy information when we update dirstate

  hg was keeping the copy state and marking things as copied on
  multiple commits

- files that are renamed should have no parents

  if you do a rename/copy to an existing file, it should not be marked
  as descending from its previous revisions.

- remove spurious print from filelog.renamed

- add some more copy tests
2005-08-27 22:04:17 -07:00
mpm@selenic.com
49950bfbc2 Fix dirstate imports 2005-08-27 16:42:03 -07:00
mpm@selenic.com
016db4f3e8 Adjust some imports 2005-08-27 14:59:25 -07:00
mpm@selenic.com
e175fdde9b Break apart hg.py
- move the various parts of hg.py into their own files
- create node.py to store node manipulation functions
2005-08-27 14:21:25 -07:00