Commit Graph

15443 Commits

Author SHA1 Message Date
Matt Mackall
3c5a04f076 graft: add a test 2011-10-24 17:01:49 -05:00
Matt Mackall
b7f097bf54 graft: fix duplicate filter logic 2011-10-24 16:57:14 -05:00
Matt Mackall
0d1e03e15b graft: fix duplicate scan message 2011-10-24 16:57:14 -05:00
Matt Mackall
226e1ff7c0 util: don't complain about '..' in path components not working on Windows 2011-10-24 16:57:14 -05:00
Matt Mackall
11a871ed47 graft: fix formatting of message 2011-10-24 12:09:12 -05:00
Thomas Arendsen Hein
a8bcd5c9b6 largfiles: drop unused import 2011-10-24 13:58:01 +02:00
Thomas Arendsen Hein
51c498ead0 consistency: use util.realpath instead of os.path.realpath where useful
exceptions:
  hg: os.path.realpath used before util can be imported
  tests/run-tests.py: may not import mercurial modules
2011-10-24 13:51:24 +02:00
Thomas Arendsen Hein
8d8608054c keyword: use util.realpath instead of os.path.realpath
This makes test-keyword.t pass on Python 2.4.1 (e.g. Debian sarge)
2011-10-24 13:54:59 +02:00
Thomas Arendsen Hein
f4c6197057 posix: workaround for os.path.realpath bug in Python 2.4.1 and before
os.path.realpath didn't resolve symlinks that were the first component of
the path, see http://bugs.python.org/issue1213894
2011-10-24 13:32:23 +02:00
Martin Geisler
2ad46f5487 largefiles: improve markup in module help text 2011-10-24 10:08:58 +02:00
Martin Geisler
9fd08bafd7 largefiles: remove redundant documentation
The extension help text already covered what was in usage.txt and
design.txt is now moved to the wiki:

  http://mercurial.selenic.com/wiki/LargefilesExtension
2011-10-24 09:54:02 +02:00
Greg Ward
1ef2baf38c largefiles: use ui.configpath() where appropriate 2011-10-23 14:25:48 -04:00
Greg Ward
220535eb62 largefiles: drop more unnecessary compatibility checks 2011-10-23 10:23:31 -04:00
Matt Mackall
788df2a72b windows: sanity-check symlink placeholders
On Windows, we store symlinks as plain files with the link contents.
Via user error or NFS/Samba assistance, these files often end up with
'normal' file contents. Committing these changes thus gives an
invalid symlink that can't be checked out on Unix.

Here we filter out any modified symlink placeholders that look
suspicious when computing status:

- more than 1K (looks more like a normal file)
- contain NULs (not allowed on Unix, probably a binary)
- contains \n (filenames can't contain \n, very unusual for symlinks,
  very common for files)
2011-10-23 16:32:27 -05:00
Thomas Arendsen Hein
13fb03d281 largefiles: use util.sha1() instead of hashlib.sha1() everywhere 2011-10-23 21:59:15 +02:00
Thomas Arendsen Hein
e0dfb62c23 tests: check for svn >= 1.3 and >= 1.5 in tests that require those versions 2011-10-23 21:22:55 +02:00
Thomas Arendsen Hein
846f225a93 convert: add missing import of util, needed for svn < 1.6 2011-10-22 23:42:48 +02:00
Thomas Arendsen Hein
e30c56ef39 run-tests: make sure no_proxy/NO_PROXY are empty to fix test-http-proxy.t
If no_proxy (or NO_PROXY) includes localhost, the test for detecting an
unreachable proxy fails, because the proxy setting is ignored.
2011-10-22 23:21:38 +02:00
Greg Ward
520457ceba largefiles: test "lfconvert --to-normal" with rename/remove/merge
This gets us very close to full test coverage of lfconvert. The only
features not tested are:
- .hgtags conversion
- abort when largefile becomes symlink
2011-10-22 15:39:51 -04:00
Greg Ward
a9c8718766 largefiles: test lfconvert with rename, remove, and merge 2011-10-22 15:16:52 -04:00
Greg Ward
ce40a4d923 largefiles: beef up test-lfconvert.t so it's more thorough
- instead of converting a single changeset with a single file, convert
  two changesets which each add a mix of normal and large files
- make one of the large files not-so-large, but identified as large
  by filename
- use shorter, simpler filenames
- put some files in a subdirectory
- test that file contents are correctly converted
- drop unnecessary cleanup step
2011-10-22 14:52:05 -04:00
Greg Ward
04bcf1ecd1 largefiles: rearrange how lfconvert detects non-local repos
Mainly this is so we can test that code; it has the side benefit of not
requiring network I/O to reject non-local repo URLs.
2011-10-22 14:20:17 -04:00
Greg Ward
8c2e55bcd4 largefiles: test lfconvert error handling; remove redundant code 2011-10-22 14:17:19 -04:00
Greg Ward
48b00ec7da largefiles: extract test-lfconvert.t from test-largefiles.t
test-largefiles.t is getting pretty big, and there's lots more to test
in lfconvert. And lfconvert is a fairly orthogonal feature to the
rest of largefiles.
2011-10-22 13:48:56 -04:00
Matt Mackall
3044265f69 windows: recompute flags when committing a merge (issue1802)
Before this patch, Windows always did the wrong thing with exec bits
when committing a merge: consult the flags in first parent.

Now we manually recompute the result of merging flags at commit time,
which almost always does the right thing (except when there are
conflicts between symlink and exec flags).

To do this, we:

- pull flag synthesis out into its own function
- delay building this function unless it's needed
- add a merge case that compares flags in local and other against the ancestor

This has been tested in multiple ways on Linux:

- running the whole test suite with both old and new code in place,
  checking for differences in each flags() result
- running the whole test suite while comparing real on-disk flags
  against synthetic ones for merges
- test-issue1802 (from Martin Geisler) which disables exec bit
  checking on Unix
2011-10-22 16:12:33 -05:00
Andrew Pritchard
f08a46d761 largefiles: test interaction between largefiles and vanilla clients and servers
This reintroduces tests for the case described by issue3066, among others:
- vanilla clients and servers should still be able to talk to largefiles
  clients and servers about vanilla repos
- vanilla clients should not attempt to clone largefiles repos over http and
  should report a useful error message (issue3066; this appears to work
  correctly)
- vanilla clients should not attempt to clone largefiles repos over ssh, again
  with a useful error message
- largefiles clients should not attempt to push largefile changes to vanilla
  servers
2011-10-21 15:09:33 -05:00
Matt Mackall
0e1a6951ac tests: darcs > 2.5 got "smart" about encoding, disable encoding tests
We can no longer convert a repo with mixed encodings, nor can I even
figure out how to get Darcs to display such messages.
2011-10-22 11:21:00 -05:00
Matt Mackall
b7430f065a check-code: catch BaseException and os.path.relpath 2011-10-21 16:52:23 -05:00
Matt Mackall
be346e0be1 largefiles: py2.4 doesn't have BaseException
..and it's the wrong base class anyway.
2011-10-21 16:52:16 -05:00
Greg Ward
a3607c833a largefiles: rename lfconvert --tonormal option to --to-normal 2011-10-20 21:56:30 -04:00
Greg Ward
f8ef8e5ee3 largefiles: test lfconvert --tonormal 2011-10-20 22:01:05 -04:00
Greg Ward
e5f3dc74a5 largefiles: use smaller files in test script 2011-10-20 22:24:24 -04:00
Greg Ward
0413d50966 largefiles: test that minimum size can be a float
This allows us to drop the existing test of --lfsize, since it's
redundant with the new test.
2011-10-20 22:22:24 -04:00
Greg Ward
b4d623e019 largefiles: polish comments in test script 2011-10-20 22:14:11 -04:00
Kevin Bullock
dd00f9e122 import: abort usefully if no patch name given 2011-10-21 11:10:43 -05:00
Pierre-Yves David
4d3328f835 revset: disambiguous the node variable
The module could be confused with the function.
2011-10-21 14:15:58 +02:00
Matt Mackall
01c8789013 revset: deal with empty lists in formatspec 2011-10-21 12:12:21 -05:00
Christian Ebert
81060c2149 keyword: correct grammar in iskwfile docstring 2011-10-21 12:07:27 +01:00
Benjamin Pollack
2e57592170 largefiles: remove all uses of os.path.relpath for 2.4 compatibility 2011-10-20 17:40:25 -04:00
Hao Lian
1705e29378 largefiles: replace tempfile.NamedTemporaryFile with tempfile.mkstemp
This is consistent with the rest of Mercurial's code, mirroring the
try-finally-unlink structure elsewhere. Furthermore, it fixes the case where
largefiles throws an IOError on Windows when the temporary file is opened a
second time by copytocacheabsolute.

This patch creates the temporary file in the repo's largefiles store rather than
/tmp, which might be a different filesystem.
2011-10-20 17:24:59 -04:00
Matt Mackall
bbf72a4e6e util: allow sha1() with no args
Normally this works because we replace util.sha1 with hashlib.sha1
after first use, but if the first user doesn't provide an arg, it
breaks.
2011-10-31 14:22:11 -05:00
Matt Mackall
a5d3d42e92 tests: use md5sum.py instead of sha1sum, add check 2011-10-31 14:22:11 -05:00
Yuya Nishihara
0a388fca31 setup: set whole env for running hg even if .hg doesn't exist (issue3073)
The issue was partially fixed by 4576ace762a0, but there were missing
variables to run build_hgextindex.
2011-10-31 00:42:32 +09:00
Patrick Mezard
0a3c1ef904 mq: avoid data loss upon qfold + qmv (issue3058)
When renaming a patch A as B where B was previously qfolded into A and
therefore marked as removed, a versioned MQ would first restore B before
marking it as a copy of A, thus losing A changes. The undelete() call is
probably a left-over, wctx.copy() explicitely handles the case where the
destination is removed.

Also note that status command represents "hg rm b; hg mv a b" as:

  A b
    a
  R a

which explains the first hunk in test-mq-qrename.t.
2011-10-20 16:43:31 +02:00
Martin Geisler
acfa971cf1 subrepos: abort commit by default if a subrepo is dirty (BC)
This changeset flips the default value of ui.commitsubrepos setting
from True to False and adds a --subrepos flag to commit.

The commit, status, and diff commands behave like this with regard to
recusion and the ui.commitsubrepos setting:

          | recurses      | recurses
          | by default    | with --subrepos
  --------+---------------+----------------
  commit: | commitsubrepo | True
  status: | False         | True
  diff:   | False         | True

By changing the default from True to False, the table becomes
consistent in the two columns:

* without --subrepos on the command line, commit will abort if a
  subrepo is dirty and status/diff wont show changes inside subrepos.

* with --subrepos, all three commands will recurse.

A --subrepos flag on the command line overrides the config settin.g
2011-10-21 00:33:08 +02:00
Benjamin Pollack
8d2d1f2b4b largefiles: use XDG and OS X-specific cache locations by default (issue3067) 2011-10-20 17:05:13 -04:00
Benjamin Pollack
164bde4288 largefiles: remove redundant any_ function 2011-10-19 20:40:55 -04:00
Eli Carter
e9e5e67cfe largefiles: testcase to simulate inter-user clone on local machine 2011-10-20 09:35:37 -05:00
Benjamin Pollack
ec794ad869 largefiles: make the store primary, and the user cache secondary
This uses the now-properly-named functions and methods from the previous
patch to actually deliver the desired behavior
2011-10-20 13:24:11 -04:00
Benjamin Pollack
417391117f largefiles: rename functions and methods to match desired behavior
The original intent was that the largefiles would primarily be in the
repository, with the global cache being only that--a cache.  The naming
conventions and actual intent have both strayed.  In this first patch, the
naming conventions are switched to match the actual intent, as are the
configuration options.
2011-10-20 13:24:09 -04:00