Commit Graph

3266 Commits

Author SHA1 Message Date
Matt Mackall
2f72e8b497 largefiles: avoid checking requirements on every command
When largefiles is enabled, commands on large repositories which don't
require largefiles could be slowed down substantially. Disable
checking this for every command.
2011-10-29 17:38:13 -05:00
Na'Tosha Bard
0e6729399b largefiles: fix bad bug where transplanting a changeset with a largefile will result in an old largefile being comitted later on 2011-10-28 18:48:24 +02:00
Matt Mackall
b066b57e3c backout 17bc9a6bb165 (issue3077) (issue3071)
Using util.realpath turns out to create complex issues on both Mac and
Windows. Back this change out for the release.
2011-10-29 11:02:23 -05:00
Martin Geisler
af63514154 largefiles: fix uppercase in abort message 2011-10-28 15:00:21 +02:00
Hao Lian
a546b17ca3 largefiles: remove lfutil.createdir, replace calls with util.makedirs 2011-10-25 11:45:28 -04:00
Eli Carter
fbbaf602df largefiles: bugfix for symlink handling with testcase
The code was using the size of a symlink's target, thus wrongly making symlinks
to large files into largefiles themselves.  This can be demonstrated by
deleting the symlink and then doing an 'hg up' or 'hg up -C' to restore the
symlink.
2011-10-26 13:48:33 -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
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
Thomas Arendsen Hein
13fb03d281 largefiles: use util.sha1() instead of hashlib.sha1() everywhere 2011-10-23 21:59:15 +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
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
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
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
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
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
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
Benjamin Pollack
8e3ea85821 largefiles: fix documentation to match desired behavior 2011-10-20 13:24:08 -04:00
Eli Carter
5a07405554 largefiles: fix newline for lfconverted repos 2011-10-18 17:28:26 -05:00
Eli Carter
d76a96462f largefiles: remove 1.9 compat code 2011-10-19 15:37:03 -05:00
Greg Ward
6e7f580a2b largefiles: fix some badly named function parameters
overrides.py contains several functions that temporarily override
scmutil.match(), which always takes a changectx object as the first
parameter. But these overrides name that parameter either 'repo' or
'ctxorrepo', which is misleading. So rename them to 'ctx' and remove
the special type-sensitive handling of the one called 'ctxorrepo'.
2011-10-16 10:24:45 -04:00
Greg Ward
522fc48c21 largefiles: tidy imports
- no need to defensively import scmutil
- remove duplicate
- unwrap non-long line
2011-10-16 10:29:51 -04:00
Greg Ward
31a67df419 largefiles: rename config setting 'size' to 'minsize' 2011-10-18 20:06:23 -04:00
Eli Carter
2df068a441 largefiles: include 'largefiles' in converted repository requirements 2011-10-18 16:40:59 -05:00
Hao Lian
e500c9817f largefiles: string formatting typo in basestore._openstore where comma is used instead of modulo 2011-10-18 17:09:03 -04:00
Eli Carter
bad1c40c51 convert: fix typo 2011-10-18 10:32:12 -05:00
Eli Carter
728847b43f largefiles: fix typo 2011-10-18 09:59:04 -05:00
Wagner Bruna
2177ac62f8 largefiles: fix typo 2011-10-17 19:10:28 -02:00
Wagner Bruna
663e6b1cd3 largefiles: make parameter more i18n-friendly 2011-10-17 19:10:42 -02:00
Matt Mackall
8268e6a737 largefiles: remove fixme from docs 2011-10-17 14:14:28 -05:00
Wagner Bruna
71a9f13a45 rebase: fix typos 2011-10-17 14:47:36 -02:00
Thomas Arendsen Hein
a33744a24e largefiles: use separate try/except and try/finally as needed for python2.4
7e9e4773f809 introduced a try/except/finally block, which breaks compatibility
with python2.4
2011-10-16 11:28:03 +02:00
Matt Mackall
c8740f2b96 rebase: simplify check for orphaned descendants 2011-10-15 14:19:24 -05:00
Matt Mackall
ceb7deb445 rebase: simplify set generation 2011-10-15 14:19:07 -05:00
Pierre-Yves David
adb2912b0c rebase: add --rev option to rebase
This option allow a strict set of revision to be specified instead of using -s
or -b. Rebase will refuse start if striping  rebased changeset will strip non
rebased changeset. Rebase will refuse to work on set with multiple root.
2011-10-15 20:12:32 +02:00
Matt Mackall
ab3ca664ae rebase: allow revsets for source and base args 2011-10-15 12:57:47 -05:00
Pierre-Yves David
92a70ff8aa rebase: use revset as soon as possible in internal logic
The buildstate function now take a set of revs. Logic related to --source and
--base option have been moved in the main rebase function.

In the process this fixes a bug where the wrong source changeset might be pick.
This explain the changes in hgext/rebase.py
2011-10-15 19:07:51 +02:00
Idan Kamara
68b09c8a1d mq: eliminate explicit checks for file existence 2011-10-14 19:51:46 +02:00
Mads Kiilerich
ab16679cb8 mq: cleanup of lookup - handling of None is not relevant
Patch specifications in mq is passed around as a string or None. None is
generally used when no patch has been specified and there thus is nothing to
lookup and the calling code should do something else. One code path did however
pass None all the way to lookup. That case was handled in lookup, but there was
really need for that, it was undocumented, and it used to cause trouble back
when patches was specified as integers.
2011-10-14 02:50:06 +02:00
Matt Mackall
e0657b708d merge with stable 2011-11-10 15:55:26 -06:00
Matt Mackall
30c1fc3bf2 mq: add a warning about uncommitted changes for qfinish 2011-11-10 15:40:34 -06:00
Matt Mackall
8f2b7260c4 merge with stable 2011-11-10 11:00:27 -06:00
Matt Mackall
d0885370c9 check-code: enable camelcase check, fix up problems 2011-11-09 16:36:54 -06:00
Matt Mackall
c735985351 merge with stable 2011-11-03 12:58:30 -05:00
Matt Mackall
fe45fca7d5 localrepo: convert various repo.set() users to repo.revs() 2011-11-02 13:51:16 -05:00
Mads Kiilerich
9c69ab7b0b mq: fix corner cases for handling of patch 0 in qselect
Most of the code paths in mq would always pass patch specifications as a
string. Patches can be specified by their index, but one code path passed that
(through pop) to lookup as an integer - all other code paths used a string.

Unfortunately pop and lookup (like many other parts of mq) used the boolean
value of the patch specification to see if it was None, and they would thus
incorrectly handle patch 0 as None.

This patch makes the code comply with the actual internal duck typing of patch
specifications: patch indices must be encoded as strings. The (now) unused code
for partial and thus incorrect handling of indices as integers is removed.
2010-10-31 18:29:56 +01:00
Greg Ward
9201e11906 largefiles: cosmetics, whitespace, code style
This is mainly about keeping code under the 80-column limit with as
few backslashes as possible. I am deliberately not making any logic or
behaviour changes here and have restrained myself to a few "peephole"
refactorings.
2011-10-13 21:42:54 -04:00
Greg Ward
f01e46c64d largefiles: more work on cleaning up comments
- always say "largefile", not "lfile"
- cleanup mangled syntax, hopefully correctly
  (punctuation: it's your friend!)
- wrap to 75 columns (where feasible)
2011-10-13 20:45:49 -04:00
Greg Ward
8b7a685468 largefiles: improve error reporting
- tweak wording of some error messages
- use consistent capitalization
- always say 'largefile', not 'lfile'
- fix I18N problems
- only raise Abort for errors the user can do something about
2011-10-13 20:24:29 -04:00
Greg Ward
5f73b6d815 largefiles: improve comments, internal docstrings
- fix some ungrammatical/unclear/incorrect comments/docstrings
- rewrite some really unclear comments/docstrings
- make formatting/style more consistent with the rest of Mercurial
  (lowercase without period unless it's really multiple sentences)
- wrap to 75 columns
- always say "largefile(s)", not "lfile(s)" (or "big files")
- one space between sentences, not two
2011-10-12 20:59:27 -04:00
Na'Tosha Bard
6b1f4db174 largefiles: speed up commit by only rewriting standins for modified largefiles 2011-10-13 12:11:25 +02:00
Greg Ward
45dea8085f largefiles: improve help
Extension help taken from the URL formerly in the text
(https://developers.kilnhg.com/Repo/Kiln/largefiles/largefiles/File/usage.txt)
and improved.
2011-10-11 21:10:03 -04:00
Greg Ward
7c5da0f076 largefiles: use ui.configlist() to split largefiles.patterns 2011-10-11 21:11:01 -04:00
Greg Ward
86647ec1cf largefiles: allow minimum size to be a float
Some old-fashioned people (e.g. me) think that incompressible
binary files >100 kB count as "large".
2011-10-11 21:07:08 -04:00
Greg Ward
184d4727fd largefiles: factor out lfutil.getminsize() 2011-10-11 21:11:01 -04:00
Na'Tosha Bard
842085d82b largefiles: cleanup import, now that we can assume > 1.9 for bundled extension 2011-10-11 14:01:24 +02:00
Na'Tosha Bard
a090606e6c largefiles: remove pre-1.9 code from extension first bundled with 1.9 2011-10-11 10:42:56 +02:00
Matt Mackall
43ea79b7dc transplant: add --edit option 2011-10-10 23:07:09 -05:00
Matt Mackall
e96d7a6bca rebase: add --edit switch 2011-10-10 23:01:25 -05:00
Matt Mackall
7d65735c38 rebase: move updatedirstate into cmdutil so it can be shared 2011-10-09 16:14:37 -05:00
Elifarley Callado Coelho Cruz
65983907f2 acl: more descriptive error messages 2011-10-06 19:45:26 -03:00
Na'Tosha Bard
bc15926c15 largefiles: fix commit of specified file on non-windows 2011-10-06 11:10:06 +02:00
jakob krainz
5eecc04f49 convert: detect false cset boundaries in cvsps descriptions 2011-10-05 10:28:39 +02:00
Greg Ward
aac3e5d5ea transplant: wrap a transaction around the whole command 2011-10-04 19:43:45 -04:00
Matt Mackall
5b7a7b3462 convert: fix crazy rollback call, broken by recent rollback safety checks
This was causing test-convert-cvs.t to fail.
2011-10-07 15:36:35 -05:00
Matt Mackall
5cb55ff80d merge with stable 2011-10-01 16:19:33 -05:00
Matt Mackall
4dc5f821e2 record: use command wrapper properly for qnew/qrefresh (issue3001) 2011-10-01 15:47:03 -05:00
Greg Ward
067c6211ff largefiles: don't break existing tests (syntax error, bad imports) 2011-10-01 16:39:51 -04:00
Greg Ward
3e3c1d99c8 rollback: avoid unsafe rollback when not at tip (issue2998)
You can get into trouble if you commit, update back to an older
changeset, and then rollback. The update removes your valuable changes
from the working dir, then rollback removes them history. Oops: you've
just irretrievably lost data running nothing but core Mercurial
commands. (More subtly: rollback from a shared clone that was already
at an older changeset -- no update required, just rollback from the
wrong directory.)

The fix assumes that only "commit" transactions have irreplaceable
data, and allows rolling back non-commit transactions as always. But
when rolling back a commit, check that the working dir is checked out
to tip, i.e. the changeset we're about to destroy. If not, abort. You
can get back the old (dangerous) behaviour with --force.
2011-09-30 21:58:54 -04:00
Matt Mackall
897fb58472 largefiles: mark a string for translation 2011-09-29 17:16:42 -05:00
Matt Mackall
ec48bece64 largefiles: fix multistatement line 2011-09-29 17:15:54 -05:00
Matt Mackall
54e711350f largefiles: eliminate naked exceptions 2011-09-29 17:14:47 -05:00
Matt Mackall
26db63c0a5 largefiles: fix over-long lines 2011-09-29 17:04:57 -05:00
Matt Mackall
4a1439d51a largefile: fix up hasattr usage 2011-09-29 16:48:48 -05:00
various
88e172f652 hgext: add largefiles extension
This code has a number of contributors and a complicated history prior to its
introduction that can be seen by visiting:

https://developers.kilnhg.com/Repo/Kiln/largefiles/largefiles
http://hg.gerg.ca/hg-bfiles

and looking at the included copyright notices and contributors list.
2011-09-24 17:35:45 +02:00
Matt Mackall
bd2e2796ed patchbomb: drop loop in prompt
There are no longer any prompts that insist on being answered, so the
loop is no longer needed, nor is most of the other logic.
2011-09-28 14:49:00 -05:00
Nikolaj Sjujskij
dbf2a41e07 building: build inotify for sys.platform='linux*'
If Python interpreter was built under Linux 3.x kernel, it reports
sys.platform to be 'linux3' (it is fixed for Python 3, but not for 2.x).
This cancels building inotify extension, which was built only for 'linux2'
platform. Improved test checks if sys.platform begins with 'linux', and together
with test for kernel version to be greater than 2.6 it seems to cover all known
cases.
2011-09-20 15:21:27 +03:00
Christian Ebert
5496330943 keyword: preserve file mode when overwriting 2011-09-08 19:30:25 +01:00
Matt Mackall
89e1387cb7 graphlog: attempt to fix index overrun (issue2912)
This bug may be caused by file subgraphs have more than two parents
per node. I have no idea if this fix is correct as the graphlog code
is mysterious, but it seems to be fine on the available test case.
2011-08-10 13:25:35 -05:00
Andrei Vermel
13bbba1de3 color.py - clear _terminfo_params in win32 mode 2011-07-29 15:36:27 +04:00
Augie Fackler
88cecc18f1 rebase: remove trailing whitespace found by check-code 2011-07-21 15:56:15 -05:00
Stefano Tortarolo
1f811e0952 rebase: block collapse with keepbranches on multiple named branches (issue2112)
Collapse and keepbranches should be blocked when there is more than
one named branch on the branch that's going to be rebased.
2011-07-18 22:58:21 +02:00
Stefano Tortarolo
80ea985fc0 rebase: reset bookmarks (issue2265 and issue2873) 2011-07-15 20:07:19 +02:00
Nicholas Riley
8b7c28a23b eol: ignore IOError from deleted files in commitctx
A Mercurial repo signals a file is deleted by raising IOError when the
file's data is requested.  This IOError is normally caught by
localrepository.commitctx.  With the eol extension enabled and EOL
mappings in place, the eolrepo subclass should ignore IOError because
a deleted file has no line endings to process.

This issue exhibited itself when performing an incremental hg convert
of a revision with deleted files to a repo with an existing .hgeol
file.
2011-07-12 12:06:11 -04:00
Cédric Krier
acde2a727f hgcia: Set default value of strip to -1 (issue2891)
For backward compatibility the root path of the repository is not
displayed unless the user has specified an explicit strip value.
2011-07-09 09:44:15 +02:00
Shun-ichi GOTO
add6b2013e win32mbcs: wrap two more functions to be wrapped.
util.checkwinfilename() and util.checkosfilename() are wrapped.
The former, used by scmutil, is not friendly for Shift_JIS bytes.
The latter is an dynamic alias of checkwinfilename() used by other
modules.
2011-07-06 18:28:42 +09:00
Brodie Rao
e231f6710d color: for the sake of "less -R", default to ansi in auto mode (issue2792)
less with the -R option only supports ANSI color codes, and terminfo
mode issue non-ANSI color codes (depending on the database). The -r
option can work around this, but there are users currently using the
-R option, and defaulting to terminfo would break colorization in less
for them without warning.
2011-06-29 13:20:40 -04:00
Brodie Rao
5123ea27df color: fix TypeError with auto mode on win32 when colors aren't available (issue2871)
This can happen when stdout isn't a terminal (e.g., it's being piped).
2011-06-29 13:20:39 -04:00
Danek Duvall
748bbc348d color: be silent when falling back to ECMA-48 mode if "auto" mode was desired
Don't warn about missing setab/setaf terminfo entries unless we explicitly
asked for terminfo mode; fallback to ECMA-48 mode silently.
2011-06-27 11:36:42 -07:00
Idan Kamara
dedd139496 transplant: use ui out descriptor when calling util.system 2011-06-24 19:27:53 +03:00
Idan Kamara
09b97b7cff extdiff: use ui out descriptor when calling util.system 2011-06-24 17:04:37 +03:00