Commit Graph

15420 Commits

Author SHA1 Message Date
FUJIWARA Katsunori
970e57770c largefiles: treat status of cache missed largefiles as "missing" correctly
"hg status" may treat cache missed largefiles as "removed" incorrectly.

assumptions for problem case:

  - there is no cache for largefile "L"
  - at first, update working directory to the revision in which "L" is
    not yet added,
  - then, update working directory to the revision in which "L" is
    already added

and now, "hg status" treats "L" as "removed".

current implementation does not allocate entry for cache missed
largefile in ".hg/largefiles/dirstate", but files without
".hg/largefiles/dirstate" entry are treated as "removed" by largefiles
extension.

"hg revert" can not recover from this situation, but "rm -rf
.hg/largefiles", because it causes dirstate rebuilding.

this patch invokes normallookup() for cache missed largefiles to
allocate entry in ".hg/largefiles/dirstate", so "hg status" can treat
it as "missing" correctly.
2011-11-11 02:33:01 +09:00
Matt Mackall
08d628312f merge with i18n 2011-11-10 11:00:02 -06:00
Martin Geisler
fb433db1d3 i18n-da: add new strings from Mercurial 2.0 2011-11-09 18:58:17 +01:00
Martin Geisler
32c5911455 i18n-ru: fix translation of --logfile (issue3095) 2011-11-09 18:26:54 +01:00
Stefano Tortarolo
b157d6deb9 rebase: ensure target is not taken as external (issue3085)
This could happen in specific situations in which 'target'
was selected as external and used for p1 _and_ p2.
2011-11-08 17:09:48 +01:00
Stefano Tortarolo
822926675c rebase: treat nullmerge as a special case in rebasestate (issue3046)
When storing/restoring a nullmerge (-2), a 'standard' conversion was made
and an existing changeset was wrongly used.
Nullmerge should instead be treated as a special case.
2011-11-06 23:35:33 +01:00
Stefano Tortarolo
a179a7e151 graft: mark a string for translation 2011-11-08 21:31:39 +01:00
Nicolas Venegas
2582d1e3d9 mdiff/patch: fix bad hunk handling for unified diffs with zero context
Prior to this patch "hg diff -U0", i.e., zero lines of context, would
output hunk headers with a start line one greater than what GNU patch
and git output. Guido van Rossum documents the unified diff format[1]
as having a start line value "one lower than one would expect" for
zero length hunks.

Comparing the behaviour of the three systems prior to this patch in
transforming

  c1
  c3

to

  c1
  c2
  c3

- GNU "diff -U0" reports the hunk as "@@ -1,0 +2 @@"
- "git diff -U0" reports the hunk as "@@ -1,0 +2 @@"
- "hg diff -U0" reports the hunk as "@@ -2,0 +2,1 @@"

After this patch, "hg diff -U0" reports "@@ -1,0 +2,1 @@".

Since "hg export --config diff.unified=0" outputs zero-context unified
diffs, "hg import" has also been updated to account for start lines
one less than expected for zero length hunk ranges.

[1]: http://www.artima.com/weblogs/viewpost.jsp?thread=164293
2011-11-09 16:55:59 -08:00
Patrick Mezard
26d7e04e93 convert/bzr: correctly handle divergent nested renames (issue3089)
With renames like:

  a   -> b
  a/c -> a/c

We were ignoring or duplicating the second one instead of leaving files
unchanged or moving them to their proper destination only.

To avoid this, we process the files in reverse lexicographic order, from most
to least specific change, and ignore files already processed.

v2:
- Add a test
- Change "reverse=1" into "reverse=True"
2011-11-08 17:08:58 +01:00
Martin Geisler
3d4a8c449c merge with main 2011-11-04 10:31:38 +01:00
David M. Carr
b8f899bd68 subrepo: improve help for svn subrepo support
Add details on which commands are supported for Subversion subrepos.
2011-11-03 23:12:31 -04:00
David M. Carr
6878ff4146 subrepo: improve help for git subrepo support
Add details on which commands are supported for git subrepos.
2011-11-03 23:12:30 -04:00
David M. Carr
4025aa1003 subrepo: update help for commit to reflect new default behavior
Update the subrepo help to be consistent with the new default behavior,
which is to abort if any subrepo is dirty.
2011-11-03 23:11:40 -04:00
Hao Lian
e92210d64e largefiles: ensure destination directory exists before findfile links to there
When (1) findfile links a largefile from the user cache to the store
and (2) the store directory doesn't exist yet, findfile errors out. A
simple call to util.makedirs fixes it.
2011-11-03 10:59:32 -04:00
Matt Mackall
864ce9da04 misc: adding missing file close() calls
Spotted by Victor Stinner <victor.stinner@haypocalc.com>
2011-11-03 11:24:55 -05:00
Wagner Bruna
ad3e245fdf i18n: disable translations with conflicting prompt keys (issue3082)
This is just a stopgap until a proper solution is implemented.
2011-11-03 10:52:58 -02:00
Matt Mackall
bd626658e2 Added signature for changeset fa55f5d988cf 2011-11-01 15:37:00 -05:00
Matt Mackall
e576cf8a52 dirstate: don't fail when dropping a not-tracked file (issue3080)
Complex merges with divergent renames can cause a file to be 'moved'
twice, causing dirstate.drop() to be called twice. Rather than try to
ensure there are no unexpected corner cases where this can happen, we
simply ignore drops of files that aren't tracked.
2011-11-01 15:19:37 -05:00
Brodie Rao
114ca03d36 tests: fix readline escape characters in heredoctest.py/test-url.py
This fix mirrors the changes made to test-doctest.py in 04cfbbc5ae97
and 39599b7929c4.

Without this change, tests running heredoctest.py can fail on certain
versions of OS X when TERM is set to xterm-256color:

   $ /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -m heredoctest <<EOF
   > >>> open('b', 'w').write('this' * 1000)
   > EOF
+  \x1b[?1034h (no-eol) (esc)

A similar problem occurs with test-url.py:

  $ ./run-tests.py test-url.py

  --- .../tests/test-url.py.out
  +++ .../tests/test-url.py.err
  @@ -0,0 +1 @@
  +
  ERROR: .../test-url.py output changed
  !
  Failed test-url.py: output changed
  # Ran 1 tests, 0 skipped, 1 failed.
2011-11-01 12:25:54 -07:00
Matt Mackall
b2142fe17e merge with i18n 2011-11-01 12:49:06 -05:00
Wagner Bruna
c89e84c137 i18n-pt_BR: synchronized with 8e74a4eb8500 2011-10-31 11:27:16 -02:00
Wagner Bruna
91c19f6dbb merge with i18n 2011-10-31 11:24:37 -02:00
FUJIWARA Katsunori
f6b7a91d98 minirst: use unicode string as intermediate form for replacement
# this change redones part of e0051068893a, backed out by 38c00c035629

Some character encodings use ASCII characters other than
control/alphabet/digit as a part of multi-bytes characters, so direct
replacing with such characters on strings in local encoding causes
invalid byte sequences.

[mpm: test changed to simple doctest]
2011-10-31 21:06:18 +09:00
Matt Mackall
9580de9b45 util: add a doctest for empty sha() calls 2011-10-31 15:41:39 -05:00
FUJIWARA Katsunori
232b6880eb i18n-ja: synchronized with 4576ace762a0 2011-10-31 20:58:49 +09:00
Matt Mackall
2988d59e97 keyword: backout realpath change (issue3071) 2011-10-30 12:10:11 -05:00
Matt Mackall
7215130ac4 strip: backout 9aac86f54486 (issue3077) 2011-10-30 12:10:09 -05:00
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
5e8efa0656 largefiles: shorten test suite by using log --template 2011-10-28 18:50:54 +02: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
Na'Tosha Bard
f4916e10c1 largefiles: test that a largefile cannot accidentally be re-added as a regular file 2011-10-28 18:17:44 +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
Thomas Arendsen Hein
467f4af92f Makefile: adjust example, test-merge1 is now test-merge1.t 2011-10-28 12:59:50 +02:00
Thomas Arendsen Hein
2e23955210 tests: use $DAEMON_PIDS and killdaemons in largefiles test
$DAEMON_PIDS is used by tests to make sure there will be no leftover
processes, the cycling through ports is needed because they are not
available for a new bind that quickly on some systems.

There are not enough $HGPORT variables available for each hg serve,
so use the killdaemons script before reusing ports.
2011-10-28 12:44:19 +02:00
Thomas Arendsen Hein
c566f581fc tests: make largefiles test use $HGPORT instead of 8001 2011-10-28 11:16:39 +02:00
Matt Mackall
4240c7a313 merge in another fix on the wrong branch 2011-10-27 18:35:07 -05:00
Brodie Rao
aabbd72d18 hgweb: fix dynamic date calculation not working under Safari
While Chrome, Firefox, and IE 6+ support the current date format being
passed to Date(), Safari doesn't:

> new Date('Mon Oct 24 13:58:01 2011 +0200')
  Invalid Date

However, the rfc822date format--officially supported by
ECMAScript[1]--does work:

> new Date('Mon, 24 Oct 2011 13:58:01 +0200')
  Mon Oct 24 2011 04:58:01 GMT-0700 (PDT)

This change replaces all instances of {date|date} in HTML with
{date|rfc822date}. For elements that only have the "age" class,
there's no outward change for users with JavaScript enabled. For
elements with both the "age" and "date" classes, the full date
displayed uses the new format.

Tested in IE 6, Safari 5.1.1, Google Chrome 15, and Firefox 7.0.1.

[1]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/parse
2011-10-27 11:57:08 -07:00
Matt Mackall
f13ffccaf7 tests: fix spurious largefiles test failure on Cygwin 2011-10-27 18:15:34 -05:00
Stefano Tortarolo
9b3ae256e5 i18n-it: fixed wrong message 2011-10-26 22:35:15 +02:00
Matt Mackall
36e0650c7d setup: set env global earlier (3073) 2011-10-26 12:56:27 -05:00
Peer Stritzinger
ed0c1f398e revert: fix missing removes when parent was changed in dirstate
When dirstate parent is changed with dirstate.setparent before a
revert so it no longer points to where the dirstate refered to, revert
does not remove all files it should:

Revert to a different revision needs also to remove files that are not
found through disptables and not in the context or parent manifest.
2011-10-26 18:47:12 +02:00
Matt Mackall
8971e5af3c check-code: fix issues with finding patterns in unified tests, fix tests
- old-style patterns without ^ were getting improperly anchored
- finditer was matching against beginning of line poorly
- \s was matching newlines
- [^x] was matching newlines

so we:

- remove earlier hacks for multiline matching
- fix unified test anchoring by adding .*
- replace \s with [ \t]
- replace [^x] with [^\nx]
- force all matches into multiline mode so ^ anchors work

This uncovers a number of test issues that are then repaired.
2011-10-27 17:22:04 -05:00
Hao Lian
a546b17ca3 largefiles: remove lfutil.createdir, replace calls with util.makedirs 2011-10-25 11:45:28 -04:00
Eli Carter
3fff6692f7 largefiles: fix typo 2011-10-26 14:22:19 -05: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
Greg Ward
3a0493a649 largefiles: test reverting largefiles (coverage creeping ever upwards)
This reveals a small bug: revert reports "reverting .hglf/largefile"
when it really should report "reverting largefile". I don't see an
easy fix, though (short of using ui.pushbuffer() to interfere with
revert's output).
2011-10-25 08:56:59 -04:00
Greg Ward
e3e10df169 largefiles: test "update --check"
It works fine; I'm just getting the test coverage up.
2011-10-24 21:33:23 -04:00
Matt Mackall
4b52621903 tests: fix check-code detection of anchored expressions, fix echo -n usage 2011-10-26 12:56:27 -05:00
Patrick Mezard
1e1f58f358 diffstat: be more picky when marking file as 'binary' (issue2816)
The 'Bin' marker was added to every changed file for which we could not find
any diff changes. This included binary files but also copy/renames and mode
changes. Since Mercurial regular diff format emits a 'Binary file XXX has
changed' line when fed with binary files, we use that and the usual git marker
to tell them from other cases. In particular, new empty files are no longer
reported as binary.

Still, this fix is not complete since copy/renames/mode changes are now
reported as '0' lines changes, instead of 'Bin'.
2011-10-24 13:41:19 +02:00