Commit Graph

2574 Commits

Author SHA1 Message Date
Alexis S. L. Carvalho
393022dbbb dirstate.statwalk: explicitly test for ignored directories
This removes a hack where we appended '/' to a dirname so that:
- it would not appear on the "dc" dict
- it would always be matched by the match function

This was a contorted way of checking if the directory was matched by
some hgignore pattern, and it would still fail with some uses of
--include/--exclude patterns.

Things would still work fine if we removed the check altogether and
just appended things to "work" directly, but then we would end up
walking ignored directories too, which could be quite a bit of work.

This allows further simplification of the match function returned by
util._matcher, and fixes walking the working directory with a
--include pattern that matches only the end of a name.
2007-03-10 23:00:54 -03:00
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
c576480d83 Leave normalization of patterns to util._matcher
Passing [] to util.cmdmatcher accidentally fixes walking of files
with "\n" in the name.
2007-03-10 23:00:46 -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
1ac4016af4 remove obsolete code from patch.diff
repo.status already does this filtering.  If the caller supplies a set of
changes, it's his responsibility to filter out what he doesn't want.
2007-03-10 23:00:43 -03:00
Alexis S. L. Carvalho
2593ea959d small globprefix fix 2007-03-10 23:00:42 -03:00
Brendan Cully
09cc2427b1 Make update with no node jump to the tip of the current branch 2007-03-10 17:36:27 -08:00
Alexis S. L. Carvalho
0458b30ebf statwalk: don't put self.root in the files list
That list is supposed to contain internal, normalized names ("/"-separated,
relative to the repo root), not OS-native paths.
2007-03-10 22:03:22 -03:00
Alexis S. L. Carvalho
fb49d2b002 Save an absolute path in repo.path
This should keep things working if the process changes directories
after creating a repo object.
2007-03-10 22:03:20 -03:00
Thomas Arendsen Hein
71a353f733 Add a features list to branches.cache to detect caches of old hg versions.
The leading space in the written file makes sure that the feature list never
can match an existing version, even if the first feature can be read as hex.
Additionally old hg versions display the id with --debug, too.
2007-03-09 19:12:03 +01:00
Thomas Arendsen Hein
92fa573aed Store empty (default) branch in branch cache, too.
Operations on this branch don't work otherwise.

Reading branches.cache had to be adjusted to allow an empty label.
Adjusted reading of the cache tip for symmetry, no functional change here.
2007-03-09 18:09:02 +01:00
Thomas Arendsen Hein
1de135fc65 Fix help text for hg status -i 2007-03-06 12:52:07 +01:00
Thomas Arendsen Hein
2c5a2d1059 Don't truncate tag and branch names after 30 chars (introduced 42bf4f46781a)
with test added for a long (local) tag name.
2007-03-05 19:48:21 +01:00
Andrei Vermel
3fdb0dcf56 Close keepalive connections to fix server traceback 2007-02-19 12:38:58 +03:00
Erling Ellingsen
3c83c5579e don't return uninitialized memory from bdiff.blocks()
bdiff.blocks() returns a dummy match at the end of both files; the
length of that chunk is never set, so it will sometimes contain random
heap garbage. There are apparently workarounds for this elsewhere:

  # bdiff sometimes gives huge matches past eof, this check eats them,
2007-02-20 22:20:16 +01:00
Patrick Mezard
c887e90ae6 web/server: disable address reuse option for BaseHTTPServer on windows
On windows, a socket with the SO_REUSEADDR option set is able to bind to
any port, even if there's already an active socket listening on it.

test-http: check server address cannot be reused.
2007-02-19 10:08:59 +01: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
Patrick Mezard
367b6626be localrepo: stream_in may raise ZeroDivisionError with nul float elapsed argument. 2007-02-19 10:29:05 +01:00
Patrick Mezard
c2f72d8974 streamclone: stream_out tried to decodefilename non-normalized paths 2007-02-19 09:59:37 +01:00
Matt Mackall
4458a1780a merge: fix renaming of subdirectories under renamed directories 2007-02-27 16:20:06 -06:00
Alexis S. L. Carvalho
8cab83c8ec git binary patches: don't print the header for identical files 2007-02-17 09:55:00 -02:00
Alexis S. L. Carvalho
fe408bb673 git binary patches: use hashes to detect identical files 2007-02-17 09:54:59 -02:00
tailgunner@smtp.ru
5474a24e48 Don't lie that "binary file has changed"
Without -a option to "hg diff", mdiff.unidiff reported that "Binary
file foo has changed" without even trying to compare things. Now it
computes MD5 of old and new files, compares them and makes the conclusion.
2007-02-17 09:54:56 -02:00
Alexis S. L. Carvalho
110602f186 hgweb: catch util.Abort raised by addchangegroup
Right now, if a pretxnchangegroup hook fails, we send some HTML
error message to the client and the transaction is not rolled back
(issue499).

Catching util.Abort allows us to send a decent message to the client
and for some reason makes the rollback complete.

This patch is not perfect since it doesn't fix the reason why the
transaction wasn't rolled back (maybe some circular references?).
Also, the transaction is aborted only after we've sent the response
back to the client and the "transaction aborted" message ends up in
the logs of the web server.
2007-02-16 05:10:43 -02:00
Alexis S. L. Carvalho
90f1713401 mail.py: don't try to use TLS if python doesn't have SSL support
This should hide the traceback from issue501.
2007-02-16 04:54:47 -02:00
Alexis S. L. Carvalho
14c4429263 git patches: handle renames of binary files 2007-02-16 04:54:46 -02:00
Alexis S. L. Carvalho
f3a8f26178 hgweb/server.py: use hg.repository to create a repo object 2007-02-15 08:49:20 -02: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
Alexis S. L. Carvalho
5334342412 hgwebdir: try to get web.style and web.motd from the ui.config system
This finishes fixing issue253.  As a bonus, web.style and web.motd
settings from ~/.hgrc will be used for the hgwebdir index page.
2007-02-13 10:02:07 -02:00
Alexis S. L. Carvalho
b169322734 Pass a ui from create_server to hgwebdir and a repo from hgwebdir to hgweb
This allows repo pages to respect hg serve --webdir-conf <file> --style=gitweb
(part of issue253).

Since we're creating a ui object anyway, use it as the parentui of the ui
objects created for every repo entry.  This has the unintended side-effect
that --name=foo on the command line will set the name of all repos.

If one of the repos being served has a .hg/hgrc owned by a user that is not
trusted, hg will now print the "Not trusting file..." warning when reading
it.  This is consistent with the behaviour from a hg serve from inside the
repo.
2007-02-13 10:01:44 -02:00
Alexis S. L. Carvalho
77c91df790 hg serve: call setconfig on the parentui
It makes sense to do this on the "global" ui object, since command line
options should affect the whole process.

This should fix hg serve --style=gitweb inside a repo (part of issue253).
2007-02-13 10:00:17 -02:00
Alexis S. L. Carvalho
9d682f1c81 Switch CGI stdout to binary on windows
Problem diagnosed by Andrei Vermel.
2007-02-13 06:50:00 -02:00
Andrei Vermel
d789a5b4fc Fix dirstate fail at drive root on Windows 2007-02-09 20:50:41 +03:00
Alexis S. L. Carvalho
06a58ad86b Try to pass repo.ui to reposetup hooks
The ui object we received in this function may belong to another repo,
which could be confusing from the hook point of view.  Trying to use
the ui object from the newly created repo should avoid this confusion.
2007-02-08 16:31:21 -02:00
Andrei Vermel
0483a4d2c4 Fix wrong module reference in copyfile exception 2007-02-06 00:09:36 +03:00
Alexis S. L. Carvalho
208d8d38e9 setup.py: reload __version__.py after writing it.
write_version loads __version__.py before writing it (see a48d939230f4),
so we have to explicitly reload it to use the correct version.

Problem diagnosed by Christian Ebert.
2007-02-06 15:55:20 -02:00
Alexis S. L. Carvalho
60b9229aaa install reposetup hook right after loading the extension 2007-02-06 15:43:01 -02:00
Alexis S. L. Carvalho
b2dff97617 Open bundle files in binary mode 2007-01-30 20:37:58 -02:00
Alexis S. L. Carvalho
9248b0bde4 filecommit: don't forget the local parent on a merge with a local rename 2007-01-30 19:09:08 -02: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
a8f8cca050 unbundle: don't use urllib if it's a local file 2007-01-30 18:32:21 -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
Benoit Boissinot
20cb213c14 mtime can be -1 after a merge and cause tracebacks on win32.
Output "unset" instead.
2007-01-30 00:26:19 +01:00
Thomas Arendsen Hein
1be2af280f Abort on empty username so specifying a username can be forced.
This behaviour was introduced by d5601ef79d86 and broken by c608116532fe.
Added test for this.
2007-01-24 23:04:51 +01:00