Commit Graph

15664 Commits

Author SHA1 Message Date
Patrick Mezard
942cefafa6 import: fix parent selection when importing merges
With "wp1" and "wp2" the current working directory parents, "p1" and "p2" the
patch parents and "parents" the resulting commit parents, the current behaviour
is:

--bypass --exact p2 parents
0        0       0  [wp1, wp2]
0        0       1  [wp1, wp2]/buggy
0        1       0  [p1]
0        1       1  [p1, p2]
1        0       0  [wp1, wp2]
1        0       1  [p1, p2]
1        1       0  [p1]
1        1       1  [p1, p2]

The original behaviour before 1f543fd375c5 was:

--bypass --exact p2 parents
0        0       0  [wp1, wp2]
0        0       1  if p1 == wp1 then [p1, p2] otherwise [wp1, wp2]
0        1       0  [p1]
0        1       1  [p1, p2]

This patch restores the previous behaviour when --bypass is not set, and align
--bypass behaviour when --exact is not set with merge diffs.
2011-11-16 12:53:10 +01:00
Patrick Mezard
16811ddcba diff: --ignore-blank-lines was too enthusiastic
It was ignoring changes from:

ab

to:

a
b
2011-11-13 21:37:14 +01:00
Stefano Tortarolo
f195f71994 graft: disallow grafting grafted csets in specific situations (issue3091)
In particular, we do not allow:
- grafting an already grafted cset onto its original branch
- grafting already grafted csets with the same origin onto each other
2011-11-12 14:00:25 +01:00
Stefano Tortarolo
2dbc061389 graft: use revs to make tests more readable 2011-11-12 11:23:52 +01:00
Stefano Tortarolo
dfee711e26 graft: preserve original source in subsequent grafts 2011-11-12 13:15:40 +01:00
Dmitry Panov
6649925e57 makedate: wrong timezone offset if DST rules changed this year (issue2511)
Python's time module sets timezone and altzone based on UTC offsets of
two dates: first and middle day of the current year. This approach
doesn't work on a year when DST rules change.

For example Russia abandoned winter time this year, so the correct UTC
offset should be +4 now, but time.timezone returns 3 hours difference
because that's what it was on 01.01.2011.

Related python issue: http://bugs.python.org/issue1647654
2011-11-13 00:29:26 +00:00
Marc-Antoine Ruel
05df0333e0 posix: fix findexe() to check for file type and access 2011-11-16 17:55:32 -06:00
Mads Kiilerich
b49a4ee31a subrepo: use correct paths for subrepos with ..-relative paths on windows
posixpath normpath of c:\foo\bar/../baz is baz, so now we pconvert first.
2011-11-15 02:16:30 +01:00
Mads Kiilerich
065de91b14 add missing localization markup 2011-11-11 01:07:10 +01:00
Mads Kiilerich
5d7000644a url: handle file://localhost/c:/foo "correctly"
The path was parsed correctly, but localpath prepended an extra '/' (as in
'/c:/foo') because it assumed it was an absolute unix path.
2011-11-16 00:10:56 +01:00
Mads Kiilerich
85ec0fb7bf help: it is 'file://localhost/', not 'file://local/'
The documentation has apparently always been wrong.
2011-11-16 00:10:52 +01:00
Matt Mackall
3eab62750e dirstate: fix case-folding identity for traditional Unix
We used to use os.path.normcase which was a no-op, which was unhelpful
for cases like VFAT on Linux.
2011-11-15 14:25:11 -06:00
Thomas Arendsen Hein
5f8b5fa5ff convert/bzr: fix test of divergent nested renames for bzr 1.x
7ad43b163555 introduced a new block in test-convert-bzr-directories.t
which produces a slightly different output with older bzr versions.
Tested with bzr 1.5 on Debian lenny.
2011-11-15 17:16:17 +01:00
Eric Roshan Eisner
5dcac2b222 subrepo: fix git status false positive (issue3109)
It turns out there's a separate command to force git to look at file contents
if the stat has changed.
2011-11-11 11:11:11 +11:11
Matt Mackall
71fadf8296 tests: fix trailing whitespace 2011-11-10 17:06:12 -06:00
Matt Mackall
79f43ffdfe hgweb: add hint about finding library path with debuginstall 2011-11-10 15:08:51 -06:00
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