Commit Graph

282 Commits

Author SHA1 Message Date
Alexis S. L. Carvalho
6ccee3793b util._matcher: unify pattern normalization
This should fix issue347.

It also highlights one issue with the directory walking code when
you have an --include pattern that matches the end of a filename.
This is fixed by the next patch.
2007-03-10 23:00:53 -03:00
Alexis S. L. Carvalho
cc4356d95d util.*matcher: change default "names" argument
names=['.'] means "include (recursively) only files from the current subdir";
the function then did a hack to walk the whole tree.  Clean that up.

This also fixes a problem where "--include ." works in a subdir, but not
on the tree root.
2007-03-10 23:00:51 -03:00
Alexis S. L. Carvalho
7a7a8339ec util._matcher: fix handling of path: patterns 2007-03-10 23:00:49 -03:00
Alexis S. L. Carvalho
a2bea59405 util._matcher: fix handling of relglob: patterns 2007-03-10 23:00:48 -03:00
Alexis S. L. Carvalho
c83e2fe93d A 'glob:foo?bar' pattern determines a root - the tree root 2007-03-10 23:00:47 -03:00
Alexis S. L. Carvalho
2f70c57d86 util._matcher: update comments
This should match the code better.  Except for bugs...
2007-03-10 23:00:45 -03:00
Alexis S. L. Carvalho
2593ea959d small globprefix fix 2007-03-10 23:00:42 -03:00
Patrick Mezard
5a74c065fc stdout raises EINVAL when flush() is called on a closed pipe under win32.
Maybe the exception should be caught and translated at raise location instead (sshserver.py).
2007-02-19 10:32:46 +01:00
Alexis S. L. Carvalho
62a7370570 Fix util.shellquote on windows. 2007-02-15 05:38:00 -02:00
Jun Inoue
db15047102 Fix accessing the repo through a symlink. 2007-02-15 05:18:23 -02:00
Andrei Vermel
0483a4d2c4 Fix wrong module reference in copyfile exception 2007-02-06 00:09:36 +03:00
Alexis S. L. Carvalho
93c60f1213 Fallback to ascii if getpreferredencoding raises an exception
Fixes issue478.
2007-01-30 18:32:23 -02:00
Alexis S. L. Carvalho
5b836109d8 docopy: deal with globs on windows in a better way 2007-01-30 18:32:20 -02:00
Alexis S. L. Carvalho
29a5332aa9 Explicitly expand globs on Windows 2007-01-30 18:32:18 -02:00
Alexis S. L. Carvalho
fa687a48e6 add util.lexists 2007-03-26 21:36:26 -03:00
Alexis S. L. Carvalho
6cbf527646 use os.path.islink instead of util.is_link; remove util.is_link 2007-03-23 23:40:25 -03:00
Eric St-Jean
18a4192512 fix util.copyfile to deal with symlinks 2007-03-21 23:20:56 -04:00
Alexis S. L. Carvalho
ec44599dd1 Merge additional fixes for my matcher changes 2007-03-20 22:21:05 -03:00
Alexis S. L. Carvalho
dd2869375e Merge some matcher fixes/cleanups and add some more hg locate tests 2007-03-16 22:58:49 -03:00
Alexis S. L. Carvalho
47cb22b5a2 Merge with crew-stable 2007-03-16 00:45:18 -03:00
Alexis S. L. Carvalho
e488c0e84f Fix handling of paths when run outside the repo.
The main problem was that dirstate.getcwd() returned just "",
which was interpreted as "we're at the repo root".  It now returns
an absolute path.

The util.pathto function was also changed to deal with the "cwd is
an absolute path" case.
2007-03-16 00:22:58 -03:00
Alexis S. L. Carvalho
fcb39243b1 pass repo.root to util.pathto() in preparation for the next patch 2007-03-16 00:22:57 -03:00
Alexis S. L. Carvalho
641d95a966 Merge a bunch of matcher and locate fixes. 2007-03-10 23:21:33 -03:00
Alexis S. L. Carvalho
93eb041452 Merge with crew-stable 2007-03-04 09:03:21 -03:00
Alexis S. L. Carvalho
c235d44d85 util_win32.py: fix user_rcpath
Fixes issue504.
2007-02-16 05:53:03 -02:00
Shane Holloway
79d891fab8 Combined the two os_rcpath methods into a single one near rcpath in mercurial/util.py
The os_rcpath method delegates to system_rcpath and user_rcpath from the
different platform implementations.
2007-02-15 09:51:57 -07:00
Alexis S. L. Carvalho
d4de823a64 merge with crew-stable 2007-02-16 05:27:37 -02:00
Shane Holloway
02d303cdfe Unified *_rcpath so the interface is similar across operating systems
Changed os_rcpath to combine system_rcpath and user_rcpath.  Changed
system_rcpath and user_rcpath to both return a list of paths to add to the
combined rcpath for both Windows NT and other platforms.
2007-02-14 15:20:06 -07:00
Alexis S. L. Carvalho
e9dc052e2a allow values that aren't strings in util.configparser 2007-02-09 03:48:26 -02:00
Matt Mackall
28f682beac Merge with stable 2007-02-06 16:12:22 -06:00
Alexis S. L. Carvalho
fff454d591 Merge with crew-stable 2007-01-30 19:36:56 -02:00
Alexis S. L. Carvalho
4f27c0fe1c catch AttributeError in util.checklink
There's no symlink function in the os module on windows.

Fixes issue468
2007-01-05 00:01:51 -02:00
Matt Mackall
2e27ddd82b symlinks: use is_link wherever is_exec is used 2006-12-29 20:04:31 -06:00
Matt Mackall
1dc3ac012f symlinks: add a linkfunc 2006-12-29 20:04:31 -06:00
Matt Mackall
5a767e44a9 symlinks: add basic symlink functions to util.py 2006-12-29 20:04:31 -06:00
Matt Mackall
4b1ae5ef0a symlinks: check whether a filesystem supports symlinks 2006-12-29 20:04:31 -06:00
Matt Mackall
30b8c51a84 exec: remove last flag from is_exec 2006-12-29 20:04:31 -06:00
Matt Mackall
9d8e9305e4 pull umask-checking up 2006-12-29 20:04:30 -06:00
Matt Mackall
b875ad6c04 exec: add execfunc to simplify exec flag support on non-exec filesystems 2006-12-29 20:04:30 -06:00
Matt Mackall
1ee7fd016e pull umask-checking up 2006-12-29 20:04:30 -06:00
Matt Mackall
a76da2edbe exec: checkexec checks whether filesystem supports exec flags 2006-12-29 20:04:30 -06:00
Alexis S. L. Carvalho
d725a42fd8 merge with crew-stable 2006-12-16 02:51:16 -02:00
Alexis S. L. Carvalho
88251bd81b util.system: fix quoting on windows 2006-12-16 02:38:18 -02:00
Matt Mackall
296d6a7cb8 Simplify i18n imports 2006-12-14 20:25:19 -06:00
Matt Mackall
f17a4e1934 Replace demandload with new demandimport 2006-12-13 13:27:09 -06:00
Benoit Boissinot
def42107f3 fix reserved char on windows, '[]+' are allowed 2006-12-10 21:53:01 +01:00
Benoit Boissinot
e5024feef0 fix errors spotted by pychecker 2006-12-10 19:41:57 +01:00
Matt Mackall
6d9bbc8702 Merge Benoit's .hg/store support 2006-12-10 02:11:02 -06:00
Matt Mackall
03f3b2efc4 make transcoding more robust
default to ASCII
abort if unknown encoding
wrap abort strings with _
add test
2006-12-09 12:46:01 -06:00
Alexis S. L. Carvalho
edf9fef62b Allow the user to specify the fallback encoding for the changelog
Example: use EUC-JP instead of ISO-8859-1:

[ui]
fallbackencoding = EUC-JP
2006-12-08 22:01:05 -02:00
Matt Mackall
d589171997 Add --date support to log
Add --date opt
Filter log with matchdate
Fix "-{days}" match format
2006-12-06 15:29:17 -06:00
Matt Mackall
d7141083eb Add date matching support
Add extended date formats (eg "Dec", "2006")
Add a couple missing basic date formats
Improve default date element scheme to parsedate
Add matchdate function to match a date spec
Add -e switch and range matching to debugdate
2006-12-06 15:11:44 -06:00
Matt Mackall
dcf070dde9 parsedate: add UTC and GMT timezones 2006-12-06 13:13:42 -06:00
Matt Mackall
63c91a1801 improve date parsing for numerous new date formats
Add lots of new date formats
Formats without year, month, or day default to current
Strip leading and trailing whitespace
2006-12-06 13:13:31 -06:00
Matt Mackall
fb391fcb13 parsedate: allow '' for epoch 2006-12-06 13:13:27 -06:00
Matt Mackall
9630fc215f parsedate: use Abort rather than ValueError 2006-12-06 13:13:26 -06:00
Benoit Boissinot
e005ffc8c4 switch to the .hg/store layout, fix the tests 2006-12-01 13:34:09 +01:00
Benoit Boissinot
31a06c4e2b create the encode and decode functions for the store 2006-12-10 00:07:02 +01:00
Matt Mackall
2356030286 imported patch folding 2006-12-04 17:10:29 -06:00
Matt Mackall
3982f645e8 Add functions for transcoding and manipulating multibyte strings 2006-12-03 16:16:33 -06:00
Matt Mackall
8b091a9c1d Add encoding detection 2006-12-03 16:16:33 -06:00
Thomas Arendsen Hein
9b62ceebc7 Move ellipsis code to util.ellipsis() and improve maxlength handling. 2006-12-02 22:35:17 +01:00
Benoit Boissinot
3bad25e752 only print a warning when no username is specified
- revert most of 8b55c0ba
- display the username during interactive commit
2006-11-28 21:16:05 +01:00
Alexis S. L. Carvalho
6e218edeb5 Avoid looking up usernames if the current user owns the .hgrc file
Converting uids into usernames may be somewhat expensive when NIS
or LDAP is involved.
2006-11-18 23:51:14 -02:00
Thomas Arendsen Hein
411d64ce3e white space and line break cleanups 2006-11-17 08:06:54 +01:00
Alexis S. L. Carvalho
2a74758338 fix util.pathto
All users of this function pass a local path (which uses os.sep) as the
first argument and a "/"-separated path as the second argument.
2006-11-15 18:56:47 -02:00
Matt Mackall
0cc86247a3 util: add copyfile function 2006-11-13 13:26:57 -06:00
Thomas Arendsen Hein
11cdc6b21b Merge with upstream 2006-10-27 23:09:46 +02:00
Matt Mackall
e803b50ef2 Make util.unique return a list 2006-10-27 14:06:32 -05:00
Matt Mackall
24c7fbb0f1 shortname: truncate at '.' too 2006-10-27 11:30:20 -05:00
Thomas Arendsen Hein
a0477d89a5 New UnexpectedOutput exception to catch server errors in localrepo.stream_in
If the unexpected is a string, the empty string will be mentioned, and long
strings are cut to at most 400 chars.
2006-10-27 18:17:12 +02:00
Alexis S. L. Carvalho
c44cea1532 Only read .hg/hgrc files from trusted users/groups
The list of trusted users and groups is specified in the [trusted]
section of a hgrc; the current user is always trusted; "*" can be
used to trust all users/groups.

Global hgrc files are always read.

On Windows (and other systems that don't have the pwd and grp modules),
all .hg/hgrc files are read.

This is essentially the same patch that was previously applied as
revision f077d29b114d.
2006-10-26 19:25:44 +02:00
Benoit Boissinot
dc9483558a makes username mandatory 2006-10-18 22:24:03 +02:00
Alexis S. L. Carvalho
a85d162373 Use a case-sensitive version of SafeConfigParser everywhere
This change has the potential to break existing setups, but the current
behaviour (the keys in configuration files are always lower-cased) can
bite us in a few places:

- no way to use a Command in [defaults]
- hgext.Extension doesn't work in [extensions]
- you can't use an Upper/case/PATH in the [paths] section of hgweb.config
- you can't (easily) protect paths with upper-case letters with the
  acl extension
- you can't specify a /Path/TO/a/rEPO in the [reposubs] section for
  the notify extension
2006-10-16 15:38:53 -03:00
Jose M. Prieto
7670d11c8a Add documentation about the date formats allowed in the command line 2006-10-03 12:33:22 +02:00
Jose M. Prieto
a76c2de547 util.strdate: assume local time when no timezone specified 2006-10-03 12:33:18 +02:00
Jose M. Prieto
06cffb7de4 util.strdate: compute timestamp using UTC, not local timezone 2006-10-03 12:33:14 +02:00
Thomas Arendsen Hein
9b9bf4b064 shortuser should stop before the first space character.
Examples:
"Foo Bar <foo.bar AT example DOT com>" -> "foo.bar"
(instead of "foo.bar AT example DOT com>" as it was before.)
"Foo Bar" -> "Foo"
2006-09-27 20:34:52 +02:00
Benoit Boissinot
38d7621ab8 add comments in cachefunc 2006-09-22 17:58:22 +02:00
Brendan Cully
d30b83d2de Add cachefunc to abstract function call cache 2006-09-22 08:19:25 -07:00
Benoit Boissinot
2caa3e642d fix warnings spotted by pychecker 2006-09-18 17:43:31 +02:00
Vadim Gelfer
853998bf60 fix issue 322.
do not allow to add files that shadow files or directories already in dirstate.
2006-08-18 21:03:29 -07:00
Vadim Gelfer
92dd5b8dc0 move commands.addremove_lock to cmdutil.addremove 2006-08-13 16:57:45 -07:00
Vadim Gelfer
2eab8e108e merge git patch code. 2006-08-12 12:47:18 -07:00
Vadim Gelfer
dc377b58c1 update copyrights. 2006-08-12 12:30:02 -07:00
Brendan Cully
4f1b3a83bb Move patch-related code into its own module. 2006-08-11 15:50:16 -07:00
Brendan Cully
7601c19932 Teach import to understand git diff extensions.
Vanilla patch chokes on git patches that include files that are copied
or renamed, then modified. So this code detects that case and rewrites
the patch if necessary.
2006-08-11 15:50:07 -07:00
Benoit Boissinot
dc4c4a5959 util.patch: use shellquote 2006-08-06 16:42:36 +02:00
Brendan Cully
5d7f00c97d Add portable shell-quoting function; teach mq to use it. 2006-08-05 15:23:26 -07:00
Vadim Gelfer
74f5dcdc3d import: make patch apply if run in subdir
fix is same as for mq patch. patch apply code should be merged.
2006-08-01 15:51:13 -07:00
Vadim Gelfer
b7a96d1742 clean up hg.py: move repo constructor code into each repo module 2006-07-31 07:11:12 -07:00
Vadim Gelfer
4f0a39d96b util.getuser: better comments 2006-07-24 09:22:47 -07:00
Vadim Gelfer
b5dfaa64f0 util.getuser: raise exception if win32api not available. 2006-07-24 09:19:25 -07:00
Vadim Gelfer
07de9b45fd fix windows username problem. 2006-07-24 09:11:26 -07:00
Vadim Gelfer
9ea4436262 add support for streaming clone.
existing clone code uses pull to get changes from remote repo.  is very
slow, uses lots of memory and cpu.

new clone code has server write file data straight to client, client
writes file data straight to disk.  memory and cpu used are very low,
clone is much faster over lan.

new client can still clone with pull, can still clone from older servers.
new server can still serve older clients.
2006-07-14 11:17:22 -07:00
Chris Mason
e09c656d7d util.parsedate should understand dates from hg export 2006-07-13 09:40:01 -07:00
Vadim Gelfer
a7c3b963b0 move most of tag code to localrepository class. 2006-07-12 08:59:20 -07:00
Benoit Boissinot
7dd019b60b use __contains__, index or split instead of str.find
str.find return -1 when the substring is not found, -1 evaluate
to True and is a valid index, which can lead to bugs.
Using alternatives when possible makes the code clearer and less
prone to bugs. (and __contains__ is faster in microbenchmarks)
2006-07-09 01:30:30 +02:00
Benoit Boissinot
fbf78b7285 str.rsplit does not exist in python 2.3 2006-06-30 23:02:08 +02:00
Benoit Boissinot
eb4253c05c validate the resulting date in parsedate 2006-06-30 18:48:06 +02:00