Commit Graph

3241 Commits

Author SHA1 Message Date
rupert.thurner@gmail.com
8e267a0e78 add import from url capability 2007-08-20 22:02:05 +02:00
Alexis S. L. Carvalho
3b929dfbb5 path_auditor: cache names of audited directories
We use a separate cache to avoid problems with

audit = path_auditor(repo.root)
audit("subrepo")
audit("subrepo/file")

whitelisting "subrepo" (which is fine) and then using the same whitelist
with "subrepo/file" (which is not fine).

Since we create a separate path_auditor for every path on the command line,
a "hg add dir/a dir/b dir/c" will still lstat dir 3 times just to audit
the paths.
2007-08-18 21:36:10 -03:00
Alexis S. L. Carvalho
d11dad17a3 Remove demandimport.enable from dispatch.py 2007-08-18 14:25:55 -03:00
Thomas Arendsen Hein
90d76a6ec9 Enable demandimport only in scripts, not in importable modules (issue605)
This way other applications can choose if and when they want this feature,
because it might be problematic if those applications rely on ImportError.
2007-08-18 11:37:08 +02:00
Alexis S. L. Carvalho
1ee06d75a7 Merge with crew-stable 2007-08-17 23:20:13 -03:00
Alexis S. L. Carvalho
11336d4a94 Fix sshrepo.unbundle
We weren't reading all the data sent by the server.  Depending on
the system, the remote hg (actually, the remote python) could send a
"close failed: [Errno 32] Broken pipe", making some tests fail.
2007-08-17 22:43:38 -03:00
Peter Meerwald
263e23ecf3 recognize user:password in URLs that include port numbers.
when giving user/pwd in an URL, eg.
hg pull http://user:pwd@host.com:666/hg/something,
hg would still ask for user/pwd in interactive mode (or fail in
non-interactive)
2007-08-17 22:43:38 -03:00
Alexis S. L. Carvalho
0f222fbdf3 Move enabling of demandimport to dispatch.py
This avoids loading many modules before enabling demandimport.
2007-08-17 17:33:27 -03:00
Alexis S. L. Carvalho
dc23a7db18 Move cmdtable and reposetup handling out of extensions.py
A new function (extensions.extensions) allows the code that is
interested in those attributes to handle them directly.

This allows some cleanups of extensions.py.  Notably, we can
remove the extensions.commandtable hack.

It also makes it easier to add standard extension attributes,
like a "hgwebsetup" function or a "helptable" dict that augments
the data in help.py, etc.
2007-08-17 17:33:27 -03:00
Matt Mackall
7065cf1716 Merge with crew 2007-08-17 00:35:16 -05:00
Benoit Boissinot
0369364273 merge with -stable 2007-08-17 00:43:49 +02:00
Benoit Boissinot
c012edc900 clone: do not delete the target if only the update fails 2007-08-17 00:42:22 +02:00
Matt Mackall
57b8fee517 verify: report expected linkrev 2007-08-15 16:55:15 -05:00
Matt Mackall
c08427e0e8 dispatch: move command dispatching into its own module
- move command dispatching functions from commands and cmdutil to dispatch
- change findcmd to take a table argument
- remove circular import of commands in cmdutil
- privatize helper functions in dispatch
2007-08-15 16:55:13 -05:00
Matt Mackall
1d9daf6473 move parseurl from cmdutil to hg 2007-08-15 16:10:36 -05:00
Matt Mackall
2bf7253b8a fix-up references to repo.RepoError 2007-08-15 16:10:24 -05:00
Matt Mackall
b4f06de2ba remove unneeded imports of mdiff 2007-08-15 16:09:50 -05:00
Patrick Mezard
4ad44c80f1 Merge with crew-stable 2007-08-15 16:43:40 +02:00
Patrick Mezard
498ca5601a Fix issue 685: trackback in grep -r after rename 2007-08-15 16:09:04 +02:00
Benoit Boissinot
eb931a15ff fix bundlerepo broken by f778fb08323c
since we now use struct in case of lazy parser, this have to be an integer
instead of None
see issue681
2007-08-14 18:25:27 +02:00
Patrick Mezard
1c4c581aa9 Merge with crew-stable 2007-08-14 16:30:38 +02:00
Patrick Mezard
38b7c18bab demandimport: ignore resource module, not available under Windows. 2007-08-14 16:03:15 +02:00
Patrick Mezard
e7663b6ff8 demandimport: ignore pwd and grp.
Both are unavailable under Windows and tarfile detects them via ImportError.
2007-08-13 19:42:52 +02:00
Patrick Mezard
9e00bc29ee demandimport: ignore pwd and grp.
Both are unavailable under Windows and tarfile detects them via ImportError.
2007-08-13 19:42:52 +02:00
Patrick Mezard
aebb857395 util: ignore invalid path errors in path_auditor. 2007-08-13 19:42:50 +02:00
Alexis S. L. Carvalho
a866998db8 merge with crew-stable 2007-08-12 12:43:52 -03:00
Alexis S. L. Carvalho
664fc9f5dd merge: fix a copy detection bug (issue672)
When merging rev1 and rev2, we want to search for copies that happened
in rev1 but not in rev2 and vice-versa.  We were starting the search at
rev1/rev2 and then going back, stopping as soon as we reached the revno
of the ancestor, but that can miss some cases (see the new
test-issue672).

Now we calculate the revisions that are ancestors of rev1 or rev2 (but
not both) and make sure the search doesn't stop too early.

Simplified test provided by mpm, based on a test case provided by
Edward Lee.
2007-08-12 12:15:10 -03:00
Thomas Arendsen Hein
beed59edcd merge with crew-stable 2007-08-11 13:35:25 +02:00
Thomas Arendsen Hein
37a2cd8e7d fancyopts: Copy list arguments in command table before modifying.
Before this, executing
commands.dispatch(['log', '-r', '0'])
commands.dispatch(['log', '-r', 'tip'])
would look like:
hg log -r 0
hg log -r 0 -r tip

Reported by TK Soh, patch by Alexis S. L. Carvalho
2007-08-11 13:07:47 +02:00
Bryan O'Sullivan
6cbcae9959 Make a few portability improvements to path auditing code. 2007-08-10 10:51:47 -07:00
Bryan O'Sullivan
1b98353d91 Make audit_path more stringent.
The following properties of a path are now checked for:

    - under top-level .hg
    - starts at the root of a windows drive
    - contains ".."
    - traverses a symlink (e.g. a/symlink_here/b)
    - inside a nested repository

If any of these is true, the path is rejected.

The check for traversing a symlink is arguably stricter than necessary;
perhaps we should be checking for symlinks that point outside the
repository.
2007-08-10 10:46:03 -07:00
Bryan O'Sullivan
d003ab09e5 debugstate: print symlinks as 'lnk', not '777' 2007-08-09 20:03:34 -07:00
Bryan O'Sullivan
c42c6ca456 manifest: accept -r for rev specification 2007-08-09 19:42:33 -07:00
Bryan O'Sullivan
46880a1c4f record: improve docs, improve prompts 2007-08-09 17:29:16 -07:00
Brendan Cully
127294b50c fix up previous commit for stable 2007-08-09 12:34:25 -07:00
Brendan Cully
c8c558a817 Merge with crew-stable 2007-08-09 11:37:47 -07:00
Brendan Cully
38822453d6 Cache extension load failures.
hg commands call extensions.loadall twice, once during dispatch and
once when the repository is instantiated. Without this change, load
caches successful loads, but not unsuccessful, causing errors to be
displayed twice.
2007-08-08 18:04:06 -07:00
Benoit Boissinot
5c3e74025c merge with -stable 2007-08-09 01:07:11 +02:00
Benoit Boissinot
25ee8ea56b unobfuscate part of fec055ae35cc 2007-08-09 01:04:27 +02:00
Benoit Boissinot
258f71b5a3 merge with -stable 2007-08-08 23:00:01 +02:00
Eric Hopper
e7f6d77433 Fix hgwebdir after aaaee74b883fc144cc3472c81c61157bc69374b6 broke it. 2007-08-08 22:47:30 +02:00
Benoit Boissinot
ce6a51c4eb refactor options from cmdtable
- add extracommitopts for user and date
- factor stuff
2007-08-08 12:27:20 +02:00
Thomas Arendsen Hein
e34927453f Remove trailing spaces, fix indentation 2007-08-07 10:28:43 +02:00
Thomas Arendsen Hein
001b7980f8 Remove trailing spaces 2007-08-07 10:24:33 +02:00
Thomas Arendsen Hein
bbd3ff0014 merge with crew-stable 2007-08-06 20:31:15 +02:00
Thomas Arendsen Hein
502b9e407c Update on pull -u when heads were closed (fixes issue666).
Patch written by Benoit Boissinot.

This should probably be improved in the future to handle long-living
branches, as joining two "other" heads will switch to that new head.
But this is not a new problem, as adding to the "other" head would have
switched to that new head, too.
2007-08-06 20:25:50 +02:00
Patrick Mezard
6b51a27d18 Merge with crew-stable 2007-08-06 10:57:51 +02:00
Patrick Mezard
3857228c9a Fix issue 653: symlinks checkout failure on non-supporting platforms 2007-08-06 10:08:28 +02:00
Alexis S. L. Carvalho
9107d93d2f merge with crew-stable 2007-08-06 01:00:10 -03:00
Alexis S. L. Carvalho
56d1444a26 httprepo: quote the path part of the URL
This should fix a 'hg clone "http://hg.example.org/path with spaces/"'

The code tries to do the right thing when the user passes a path that's
already escaped in part (e.g. "http://hg.example.org/path%20with spaces/").

If we're redirected, urllib2 will happily follow the URL it's given
without escaping anything.  I'm not sure what we would have to hook
to work around that.
2007-08-06 00:35:06 -03:00