Commit Graph

185 Commits

Author SHA1 Message Date
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
Paul Moore
b8887e9f02 Add a folding() method to dirstate
The method returns True if the dirstate is on a case folding filesystem.
2008-06-06 08:29:16 +01:00
Matt Mackall
fb88571d19 match: remove files arg from repo.status and friends 2008-05-12 11:37:08 -05:00
Matt Mackall
dda89645c0 dirstate: remove default from status list_unknown 2008-05-12 11:37:08 -05:00
Matt Mackall
48d9afe7e5 dirstate: minor status cleanups 2008-05-12 11:37:08 -05:00
Matt Mackall
dbcb631016 status: rename type_ to state 2008-05-12 11:37:08 -05:00
Matt Mackall
71a4886284 walk: use match.bad in statwalk 2008-05-12 11:37:08 -05:00
Matt Mackall
b4d6b6c45b walk: use match.dir in statwalk 2008-05-12 11:37:08 -05:00
Matt Mackall
7e413542cf walk: make dirstate.walk return a single value too 2008-05-12 11:37:08 -05:00
Matt Mackall
525eaf2be0 walk: remove more old badmatch logic 2008-05-12 11:37:08 -05:00
Matt Mackall
1897262320 walk: begin refactoring badmatch handling 2008-05-12 11:37:07 -05:00
Matt Mackall
15d8da57c1 walk: remove files arg from repo.walk and dirstate.walk 2008-05-12 11:37:07 -05:00
Matt Mackall
7f74aac054 walk: eliminate some default variables 2008-05-12 11:37:07 -05:00
Patrick Mezard
f572ee0b5f dirstate: do not ignore current directory '.' (issue 1078) 2008-04-05 18:15:04 +02:00
Matt Mackall
c517f4bb58 dirstate: refactor granularity code, add a test
- rename option dirstate.granularity
- move option reading into .write()
- add a simple test
2008-03-20 13:53:59 -05:00
Alexis S. L. Carvalho
d40b29d203 dirstate: ignore stat data for files that were updated too recently
This should fix the race where

  hg commit foo
  <change foo without changing its size>

happens in the same second and status is fooled into thinking foo
is clean.

A configuration item is used to determine the timeout, since different
filesystems may have different requirements (I think VFAT needs 3s,
while most Unix filesystems are fine with 1s).
2008-03-19 17:55:21 -03:00
Alexis S. L. Carvalho
dc7b734ee2 normallookup: during merges, restore the state saved by remove 2008-03-18 04:07:39 -03:00
Alexis S. L. Carvalho
cfe6940b56 dirstate.remove: during merges, remember the previous file state
We encode the previous state as a negative file size (AFAICS, previous
versions of hg always have size == 0 when state == 'r').

We save the state of 'm'erged and dirty files, because they're the
two states that indicate that a file has to be committed on a merge
to correctly record per-file history.
2008-03-18 04:07:39 -03:00
Alexis S. L. Carvalho
7a9e64075f dirstate: ignore mode changes if the fs does not supports the exec bit
This can make a difference when e.g. the repo is exported through NFS
(which support exec bits) and CIFS (which does not).
2008-03-14 09:56:58 -03:00
Joel Rosdahl
4f8012378a Remove unused imports 2008-03-06 22:23:41 +01:00
Joel Rosdahl
5dae3059a0 Expand import * to allow Pyflakes to find problems 2008-03-06 22:23:26 +01:00
Thomas Arendsen Hein
d659d68d7a Extend/correct f488b5acd598 regarding -qA and ignored files.
hg status -qA will now hide untracked files as described in the doc string.
2008-03-02 13:52:34 +01:00
Thomas Arendsen Hein
d7cabb1e8d Report filenames with disallowed characters as suggested by Mika Eloranta
(see issue671)
2008-02-17 12:53:57 +01:00
Alexis S. L. Carvalho
85673c1586 status: put added files that have disappeared in the deleted list
This gives the user an indication that something went wrong with this file:

$ hg add foo
$ rm foo
$ hg status foo
! foo

Fixes issue212.
2008-02-14 18:08:16 -02:00
Thomas Arendsen Hein
d8e42b5304 Remove trailing ! from two error messages as this was confusing. 2008-02-09 19:13:57 +01:00
Alexis S. L. Carvalho
8b9b7ae9bd Merge with crew-stable 2008-02-08 18:31:55 -02:00
Alexis S. L. Carvalho
c32e3d63c7 dirstate.status: avoid putting ignored files in the unknown list
If list_ignored was false, we would blindly add files not in the
dirstate to the unknown list.

This should finish fixing issue886.
2008-02-08 18:07:55 -02:00
Alexis S. L. Carvalho
72ccf087ac dirstate: don't walk ignored directories
With a pattern like '^directory$' in .hgignore, a "hg status directory"
would still walk "directory" and all its subdirs.

This is the first half of a fix for issue886.
2008-02-08 18:07:55 -02:00
Christian Ebert
5c18a69d2e Prefer i in d over d.has_key(i) 2008-01-20 14:39:25 +01:00
Shun-ichi GOTO
188e44cf4b Add endswithsep() and use it instead of using os.sep and os.altsep directly.
This change is intended to allow hooking endswithsep() by win32mbcs
extension for MBCS support.
2008-01-09 21:30:35 +09:00
Shun-ichi GOTO
478c0b9176 Use util.normpath() instead of direct path string operation.
This change is intended to allow hooking normpath() by win32mbcs
extension for MBCS support.
2008-01-09 21:30:13 +09:00
Maxim Dounin
084e15f969 Fix dir-changed-to-file updates on clean workdir.
Workaround for dir-changed-to-file updates mentioned
in rev c3f3393b9096 doesn't actually work since tests
introduced in mentioned changeset prevented dirstate
updates even if working directory updates succeded.

Make tests more relaxed for dirstate operations
not directly accessible from cli. See also issue660.

While here, move _dirs existance check from _decpath()
to _changepath() for unification.
2007-11-07 22:57:28 +01:00
Maxim Dounin
8561d688a1 Fix file-changed-to-dir and dir-to-file commits (issue660).
Allow adding to dirstate files that clash with previously existing
but marked for removal. Protect from reintroducing clashes by revert.

This change doesn't address related issues with update. Current
workaround is to do "clean" update by manually removing conflicting
files/dirs from working directory.
2007-11-05 20:05:44 +03:00
Bryan O'Sullivan
e317f81ab3 Add osutil module, containing a listdir function.
This is similar to os.listdir, only it returns a sorted list of tuples.
2007-10-05 15:01:06 -07:00
Matt Mackall
b7b5c1ade9 dirstate: speed up read and write
read:
- single call to len(st)
- fewer assignments for position tracking
- don't split apart tuple from unpack
- use a literal for the unpack spec

write:
- localize variables and functions
- avoid copied function call
- use % for string concatenation
2007-09-24 12:41:54 -05:00
Matt Mackall
c79b6cded5 dirstate: make dir collision logic faster
- shortcircuit decpath if we haven't built the _dirs map
- increment only for leafnodes of directory tree
  (this should make construction more like O(nlog n) than O(n^2))
2007-09-24 12:36:38 -05:00