Commit Graph

5381 Commits

Author SHA1 Message Date
Thomas Arendsen Hein
91a8201c52 merge: warn about file deleted in one branch and renamed in other (issue3074)
For divergent renames the following message is printed during merge:
note: possible conflict - file was renamed multiple times to:
 newfile
 file2

When a file is renamed in one branch and deleted in the other, the file still
exists after a merge. With this change a similar message is printed for mv+rm:

note: possible conflict - file was deleted and renamed to:
 newfile
2012-05-23 20:50:16 +02:00
Thomas Arendsen Hein
d79df9bd09 tests: do not create repos inside repos in test-rename-merge1.t
This is no actual problem, but I when adding more tests to this file,
the directory structure would become t/repo2089/repoXXXX/repoYYYY/...
2012-05-23 17:33:19 +02:00
Thomas Arendsen Hein
4735ff24c9 merge: do not warn about copy and rename in the same transaction (issue2113) 2012-05-23 17:25:48 +02:00
Matt Mackall
8c3c80ff37 merge with stable 2012-05-22 14:37:20 -05:00
Sune Foldager
aea3159eaa bundle: make bundles more portable (isue3441)
This is achieved by acting as if the user had given -r<rev> for each head rev
of outgoing changesets on the command line, as well as appropriate
--base <rev>.

The discovery information is computed as normal, and then adjusted as above.
2012-05-12 19:38:20 +02:00
Matt Mackall
dbfb64e582 hgweb: fix filediff base calculation
Previously, we were finding the most recent version of a file in a
changeset and comparing it against its first file parent. This was
wrong on three counts:

- it would show a diff in revisions where there was no change to a file
- it would show a diff when only the exec bit changed
- it would potentially compare against a much older changeset, which
  could be very expensive if git-style rename detection was enabled

This compares the file in the current context with that context's
parent, which may result in an empty diff when looking at a file not
touched by the current changeset.
2012-05-14 12:56:43 +02:00
Paul Boddie
5b2a1dc5f5 hgweb: make graph data suitable for template usage
Previously, graph data has been encoded for processing done by
JavaScript code run in the browser, employing simple structures
with implicit member positions. This patch modifies the graph
command to also produce data employing a dictionary-based
structure suitable for use with the templating mechanism, thus
permitting other ways of presenting repository graphs using that
mechanism.

In order to test these changes, the raw theme has been modified
to include templates for graph nodes and edges. In a similar
fashion, themes could employ technologies such as SVG that lend
themselves to templating to produce the graph display. This patch
makes use of a much simpler output representation than SVG in
order to maintain clarity.
2012-05-21 00:20:05 +02:00
Matt Mackall
67c0680caa merge with stable 2012-05-17 15:52:14 -05:00
Matt Mackall
7e8d9b6e6f branchcache: backout 29529231e17d 2012-05-17 15:34:59 -05:00
Augie Fackler
1d813c0d7e dispatch: try and identify third-party extensions as sources of tracebacks
Extension authors should explicitly declare their supported hg
versions and include a buglink attribute in their extension. In the
event that a traceback occurs, we'll identify the
least-recently-tested extensionas the most likely source of the defect
and suggest the user disable that extension.

Packagers should make every effort to ship hg versions from exact
tags, or with as few modifications as possible so that the versioning
can work appropriately.
2012-05-16 16:18:07 -05:00
Kevin Bullock
a4f03c7e07 bookmarks: test that bare update forwards active bookmark 2012-05-05 15:12:26 -05:00
Christian Ebert
7b42c28269 keyword: intentionally ignore check-code warning about unwrapped ui message 2012-05-13 14:26:26 +01:00
Kevin Bullock
b4041f99fa help: include bookmarks in 'help revisions' and simplify wording 2012-05-16 10:29:11 -05:00
Patrick Mezard
0e75723add mq: rename --check into --keep-changes
I named it --check because it felt like qpush & co were checking *more*
things to ensure local changes could not be lost. But it has been
pointed on the mailing list that --check is already used by update
command with a meaning almost opposite to this one. An alternative
was --keep but qfold and qdelete already have such an option to preserve
patch files and qfold may be a candidate for --check.

- qpush/qpop/qgoto --check becomes --keep-changes.
- mq.check becomes mq.keepchanges.
- The short option -c is dropped as -k may conflict with existing
  --keep. The availabilitity of mq.keepchanges should not make this too
  painful.
- Fix minor reST mistake in option description.
2012-05-13 14:00:58 +02:00
Matt Mackall
264c1fb976 merge with stable 2012-05-15 07:00:55 +02:00
Levi Bard
c5f81ed918 largefiles: don't attempt to clone all largefiles to non-local destinations 2012-05-13 22:59:22 +02:00
David Soria Parra
f8942bb230 strip: introduce -B option to remove a bookmark
Add a -B option to remove a bookmark. All revisions are unreachable
from a different head or a different bookmark will be removed too.

This helps with topic branch workflow. You can create a topic branch
and remove it if not needed anymore with hg strip -B topic/xyz.
2012-05-13 16:39:40 +02:00
Joshua Redstone
d70249edef localrepo: strip now incrementally updates the branchheads cache
Destroying history via strip used to invalidate the branchheads cache,
causing it to be regenerated the next time it is read. This is
expensive in large repos. This change converts strip to pass info to
localrepo.destroyed() to enable to it to incrementally update the
cache, improving the performance of strip and other operations that
depend on it (e.g., rebase).

This change also strengthens a bit the integrity checking of the
branchheads cache when it is read, by rejecting the cache if it has
nodes in it that no longer exist.
2012-05-11 10:35:54 -07:00
Patrick Mezard
de32ec835b test-rebase-collapse: fix Windows path separator 2012-05-13 14:29:05 +02:00
Augie Fackler
c94e6f7b05 help: add --keyword (-k) for searching help 2012-05-13 06:03:11 -05:00
David Soria Parra
7d0d5a5a60 merge: respect bookmarks during merge
Bookmarks will behave more like named branches when merge tries to pick
a revision to merge.

Bookmarks now to respect the current bookmarks.  Bookmarks will not
accidentally merged with unnamed heads or other bookmarks. However merge
can pick heads with diverging bookmarks and pick those automatically.

We end up with two cases for picking a revision to merge:
 (1) In case of an current bookmark, merge can pick a branch head that has a
     diverged bookmark
 (2) In case of no current bookmark, merge can pick a branch head that does not
     have a bookmark.
2012-05-13 11:55:42 +02:00
David Soria Parra
7ffe2b2eb4 bookmarks: delete divergent bookmarks on merge 2012-05-12 21:28:10 +02:00
Brodie Rao
7f47d4e347 check-code: ignore naked excepts with a "re-raise" comment
This also promotes the naked except check from a warning to an error.
2012-05-13 13:18:06 +02:00
Brodie Rao
46ce54af4d cleanup: replace more naked excepts with more specific ones 2012-05-13 13:17:31 +02:00
Matt Mackall
05e48d4041 merge with stable 2012-05-13 12:52:24 +02:00
Bryan O'Sullivan
18be3ce9f0 tests: make test-convert-darcs.t happier with darcs 2.8.0 2012-05-13 11:47:55 +02:00
Levi Bard
ff2ee52b29 bookmarks: pull new bookmarks from remote by default (BC) 2012-05-12 17:00:01 +02:00
Patrick Mezard
d99bfab018 rebase: allow collapsing branches in place (issue3111)
We allow rebase plus collapse, but not collapse only? I imagine people would
rebase first then collapse once they are sure the rebase is correct and it is
the right time to finish it.

I was reluctant to submit this patch for reasons detailed below, but it
improves rebase --collapse usefulness so much it is worth the ugliness.

The fix is ugly because we should be fixing the collapse code path rather than
the merge. Collapsing by merging changesets repeatedly is inefficient compared
to what commit --amend does: commitctx(), update, strip. The problem with the
latter is, to generate the synthetic changeset, copy records are gathered with
copies.pathcopies(). copies.pathcopies() is still implemented with merging in
mind and discards information like file replaced by the copy of another,
criss-cross copies and so forth. I believe this information should not be lost,
even if we decide not to interpret it fully later, at merge time.

The second issue with improving rebase --collapse is the option should not be
there to begin with. Rebasing and collapsing are orthogonal and a dedicated
command would probably enable a better, simpler ui. We should avoid advertizing
rebase --collapse, but with this fix it becomes the best shipped solution to
collapse changesets.

And for the record, available techniques are:
- revert + commit + strip: lose copies
- mq/qfold: repeated patching() (mostly correct, fragile)
- rebase: repeated merges (mostly correct, fragile)
- collapse: revert + tag rewriting wizardry, lose copies
- histedit: repeated patching() (mostly correct, fragile)
- amend: copies.pathcopies() + commitctx() + update + strip
2012-05-03 15:14:58 +02:00
Na'Tosha Bard
18869bf5f2 largefiles: add --all-largefiles flag to pull 2012-05-12 11:45:22 +02:00
Brodie Rao
a706d64a2c cleanup: replace naked excepts with except Exception: ... 2012-05-12 16:02:46 +02:00
Brodie Rao
c577fac135 cleanup: replace naked excepts with more specific ones 2012-05-12 16:02:45 +02:00
Brodie Rao
92158e04de cleanup: "raise SomeException()" -> "raise SomeException" 2012-05-12 16:00:58 +02:00
Brodie Rao
a7ef0a0cc5 cleanup: "not x in y" -> "x not in y" 2012-05-12 16:00:57 +02:00
Brodie Rao
2db5d441ca cleanup: replace hasattr() usage with getattr() in hghave 2012-05-12 16:00:53 +02:00
Brodie Rao
dd09ae96e9 cleanup: "x != None" -> "x is not None" 2012-05-12 15:56:23 +02:00
Brodie Rao
d6a6abf2b0 cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
Martin Geisler
194d85c712 test-progress: fix whitespace typo 2012-05-11 15:13:13 +02:00
Matt Mackall
4d12f82b66 merge with stable 2012-05-12 13:20:26 +02:00
Matt Mackall
8420ca3aee merge with stable 2012-05-12 12:23:49 +02:00
Henrik Stuart
97ebbbffd1 revset: add function for matching extra data (issue2767) 2012-05-12 10:20:57 +02:00
Yuya Nishihara
9228db24a3 patch: fix segfault against unified diffs which start line is zero
Since f7e538c3b7ba, if a chunk starts with "@@ -0,1", oldstart turns into
a negative value. Because diffhelpers.testhunk() doesn't expect negative bstart,
it bypasses "alen > blen - bstart" condition and segfaults at
"PyList_GET_ITEM(b, i + bstart)".
2012-05-12 16:10:01 +09:00
Levi Bard
4d4fd8dd61 graft: implement --log (issue3438) 2012-05-11 18:51:35 +02:00
Patrick Mezard
aa6e824ce1 phase: make if abort on nullid for the good reason
The good reason being you cannot call retractboundary() on nullid, not
revset.set() cannot resolve '-1'.
2012-05-12 00:24:07 +02:00
Patrick Mezard
f06b17a700 mq: introduce mq.check setting
When:

  [mq]
  check = True

is set, qpush, qpop and qgoto behave as if -c/--check were passed. If
incompatible options like -f/--force or --exact are set, this setting is
ignored.

This setting enables what many users expect mq default behaviour to be.
2012-05-12 00:19:30 +02:00
Patrick Mezard
93529cbc7c mq: introduce qgoto --check 2012-05-12 00:19:30 +02:00
Patrick Mezard
b9c8ba9be4 mq: introduce qpush --check
qpush --check let you qpush with uncommitted files not overlapping
patched files.
2012-05-12 00:19:30 +02:00
Patrick Mezard
55a575b59a mq: introduce qpop --check
qpop --check let you qpop with uncommitted files if they do not
intersect with files touched by the popped patches.
2012-05-12 00:19:30 +02:00
Bryan O'Sullivan
2493c7a8d1 bisect: set HG_NODE when runing a command
When running a command, set the environment variable HG_NODE to
tell the command which changeset is being visited.
2012-05-08 15:31:00 -07:00
Bryan O'Sullivan
01cb9841ca bisect: track the current changeset (issue3382)
Introduce a new revset feature, bisect(current), that identifies
the changeset currently being bisected.
2012-05-08 15:29:09 -07:00
Patrick Mezard
1ecfe35e64 revset: make matching() preserve input revision order 2012-05-09 18:45:14 +02:00
Patrick Mezard
22eeeffed3 mq: add --no-backup for qpush/qpop/qgoto 2012-05-11 16:57:26 +02:00
Patrick Mezard
d775dd04bb mq: backup local changes in qpush --force
qpush help says the following about --force:
1- When -f/--force is applied, all local changes in patched files will
   be lost.
2- Apply on top of local changes

In practice, qpush --force will attempt to apply the patch on top of
local changes, and on success will merge them in the pushed patch. On
failure, patched files will contain a mix of local changes (where the
patch could not apply) and a mix of patch changes (were it applied). So,
local changes are less lost than entangled with a mass of other changes.

This patch makes qpush --force backup all locally modified files touched
by the next patch being applied. When multiple patches are being pushed,
this logic is repeated for each patch. Note that modified but
successfully patched files are preserved as well.
2012-05-11 16:18:47 +02:00
Patrick Mezard
b045ed706e mq: backup local changes in qpop --force (issue3433) 2012-05-11 16:17:02 +02:00
Idan Kamara
c69934e20c amend: preserve extra dict (issue3430) 2012-05-11 18:33:45 +03:00
Bryan O'Sullivan
449c0e1dbf tests: fix test-parseindex2.py when run with --pure 2012-05-11 02:32:26 -07:00
Bryan O'Sullivan
ab8ba40835 changelog: ensure that nodecache is valid (issue3428)
This ensures that an out-of-process hook can see an incoming changegroup.
2012-05-11 01:55:33 -07:00
Patrick Mezard
9c5568246f alias: inherit command optionalrepo flag (issue3298)
Commands working without a repository, like "init", are listed in
commands.norepo. Commands optionally using a repository, like "showconfig", are
listed in commands.optionalrepo. Command aliases were inheriting the former but
not the latter.
2012-05-05 12:21:22 +02:00
Mads Kiilerich
64a9bbd95b tests: improve test of hg-ssh and make the test pass on windows 2012-05-07 00:52:11 +02:00
Mads Kiilerich
91529dce53 hg-ssh: use %s for printing paths in error messages
This avoids \\ if this ever is run on windows - for example in the test suite.
2012-05-07 00:49:01 +02:00
Mads Kiilerich
1014b093a1 tests: accept \ in test-casefolding on windows 2012-05-07 00:48:51 +02:00
Patrick Mezard
742f6b3850 pure/base85: align exception type/msg on base85.c
brendan mentioned on IRC that b64decode raises a TypeError too, but while the
previous exception type may be better in general, it is much easier to make it
behave like the related C code and changes nothing for mercurial itself.
2012-05-07 21:49:45 +02:00
Na'Tosha Bard
0f2fb0db6a largefiles: add --all-largefiles flag to clone (issue3188) 2012-05-11 23:11:43 +02:00
Matt Mackall
48471fd098 merge with stable 2012-05-12 00:06:11 +02:00
Levi Bard
23f20d7bd7 transplant: manually transplant pullable changesets with --log 2012-05-11 17:26:58 +02:00
Patrick Mezard
2940b01bad repair: no need to call filterunknown() in strip()
Calling strip() will eventually trigger localrepo.destroyed() which will
invalidate _parseroots. It will call filterunknown() upon reload.

Changes to test-keyword.t are related to commit --debug running after
either qpop or rollback.
2012-05-10 18:21:15 +02:00
Patrick Mezard
df9b03eafa test-phases: test changing null revision phase
The behaviour is correct but for bad reasons: the repo.set() call in
phase command fails for '-1'. It should be rejected explicitely by phase
boundary commands, sadly this is hard to do because phase changes are
not applied atomically.
2012-05-10 18:21:15 +02:00
Matt Mackall
6d78ec67ed merge with stable 2012-05-11 14:48:24 +02:00
Matt Mackall
153e35df5d tests: set a standard terminal type
This makes test-ui-color.py happy when run in a dumb terminal.

Spotted by Jesse Glick <jesse.glick@oracle.com>
2012-05-08 15:46:51 -05:00
Travis Herrick
c8cb411c3a branches: quiet option observes other parameters 2012-05-06 17:12:22 -07:00
Matt Mackall
d7cd292c1a merge with stable 2012-05-08 12:05:45 -05:00
Matt Mackall
e38c9f282e filectx: handle some other simple cases for finding merge ancestor 2012-05-06 14:20:53 -05:00
Matt Mackall
a7305a2b09 graft: remark on empty graft 2012-05-06 14:15:17 -05:00
Martin Geisler
db0acd4d7e merge with stable 2012-05-07 13:40:58 +02:00
Yuya Nishihara
8284425c7d commands: parse ui.strict config item as bool 2012-05-06 23:58:04 +09:00
Patrick Mezard
9b4af94333 largefiles: fix "hg status dir" missing regular files (issue3421)
largefiles status implementation attemps to rewrite the input match objects to
match the "standins" as well as the regular files. When fixing the directories
listed in match.files(), if there was related standin entry, it was kept and
the original path discarded. But directories can appear both as regular and
standin entries.
2012-05-06 13:14:58 +02:00
Martin Geisler
4640718d42 merge with stable 2012-05-06 14:36:42 +02:00
Martin Geisler
24d40d77b2 test-largefiles: better formatting of comments 2012-05-04 14:40:11 +02:00
Martin Geisler
ffc78c7061 test-largefiles: sort output to ensure test stability 2012-05-04 14:39:37 +02:00
Patrick Mezard
f49c9eec1a subrepo: do not traceback on .hgsubstate parsing errors
Note that aborting in subrepo.state() prevents "repairing" commands like revert
to be issued. The user will have to edit the .hgsubstate manually (but he
probably had already otherwise this would not be failing). The same behaviour
already happens with invalid .hgsub entries.
2012-05-04 14:19:55 +02:00
Patrick Mezard
a124dced40 subrepo: ignore blank lines in .hgsubstate (issue3424)
Reported by Sebastian Krysmanski <infomail@lordb.de>
2012-05-04 14:19:52 +02:00
hlian
992a6313f9 largefiles: in putlfile, ensure tempfile's directory exists prior to creation
Let R be a repo served by an hg daemon on a machine with an empty largefiles
cache. Pushing a largefiles repo to R will result in a no-such-file-or-directory
OSError because putlfile will attempt to create a temporary file in
R/.hg/largefiles, which does not yet exist.

This patch also adds a regression test for this scenario.
2012-05-04 14:36:40 -04:00
Martin Geisler
82b328e84d merge with stable 2012-05-04 12:21:56 +02:00
Martin Geisler
da730824fe paper, monoblue: link correctly to lines in annotate view
The links were to "foo#123" instead of "foo#l123". The gitweb and
spartan templates were already producing the correct links.
2012-05-04 12:04:07 +02:00
Matt Harbison
2a3bf0a137 largefiles: make archive -S store largefiles instead of standins
This is essentially a copy of largefile's override of archive() in the
archival class, adapted for overriding hgsubrepo's archive().  That
means decoding isn't taken into consideration, nor is .hg_archival.txt
generated (the same goes for regular subrepos).  Unlike subrepos, but
consistent with largefile's handling of the top repo, ui.progress() is
*not* called.  This should probably be refactored at some point, but
at least this generates the archives properly for now.  Previously,
the standins were ignored and the largefiles were archived only for
the top level repo.

Long term, it would probably be most desirable to figure out how to
tweak archival's archive() if necessary such that largefiles doesn't
need to override it completely just to special case the translating of
standins to the real files.  Largefiles will already return a context
with the true largefiles instead of the standins if lfilesrepo's
lfstatus is True- perhaps this can be leveraged?
2012-05-03 21:32:57 -04:00
Matt Mackall
a1bde95990 merge with stable 2012-05-03 16:12:52 -05:00
Matt Mackall
ed0ae26f56 bookmarks: catch the proper exception for missing revisions
This fixes a regression from 1.7
2012-05-03 16:03:08 -05:00
Patrick Mezard
47c2d10d02 rebase: make --dest understand revsets 2012-05-01 10:14:35 +02:00
Patrick Mezard
5e78cfbfbb subrepo/svn: fix checked out rev number retrieval (issue2968)
The initial version was to take the "Revision" field from svn info. It works
but produces false positive when parent paths are being moved or unrelated
changes are being committed, causing it to change while the svn checkout itself
remains the same. To avoid spurious commit, we took "Revision" and "Last
Changed Rev" for general comparison and kept the latter to answer "what is your
revision?" question. This is better but fails when the subrepo path exists at
"Revision" but not at "Last Changed Rev". This patch adds a check for this, and
returns "Revision" if the path does not exist. We try to avoid doing this as
much as possible at it implies an extra, *remote* call.
2012-04-30 17:03:15 +02:00
Patrick Mezard
bf0d75c9d1 amend: fix copy records handling (issue3410)
Messing with the dirstate before the intermediate commit seems error prone.
Instead, commit and recompute the copies with copies.pathcopies(), then use
that with commitctx().

Since copies.pathcopies() does not support file replacement very well, the
whole .renamed() condition in samefile() is removed and the "file replacement
caused by differing copy source" effect is discarded.

Test shamelessly stolen from Idan Kamara <idankk86@gmail.com>
2012-04-30 20:45:45 +02:00
Patrick Mezard
8f18af5bfc test-commit-amend: exhibit an --amend weirdness
The weirdness is --amend let you replace one file with another with same data
and flags if the new file copy record differ from the one in the parent
revision. In theory, there is no problem with this kind of thing, subversion
supports it, but here we see log and status disagree. The reason is log reads
the copy record from the filelog, while status calls copies.pathcopies() which
eventually invokes some expensiveness argument to discard this case (copies.py,
_forwardcopies(), line 132). Since the next patch will side with pathcopies(),
I prefer to call this behaviour a bug.
2012-04-30 20:36:29 +02:00
Patrick Mezard
2c65c226cf localrepo: add setparents() to adjust dirstate copies (issue3407)
The fix introduced in 3509b9cf8f86 was only partially successful. It is correct
to turn dirstate 'm' merge records into normal/dirty ones but copy records are
lost in the process. To adjust them as well, we need to look in the first
parent manifest to know which files were added and preserve only related
records. But the dirstate does not have access to changesets, the logic has to
moved at another level, in localrepo.
2012-04-29 22:25:55 +02:00
Patrick Mezard
2b7ed041e6 test-rebase-parameters: more tests for revset/opts
- --source and revset
- --base and revset
- --rev and revset
- --rev and --source combination
- --rev and --base combination
2012-04-29 16:18:46 +02:00
Martin Geisler
63259931d2 help: consistently use title capitalization for help topics 2012-04-30 11:51:24 +02:00
Patrick Mezard
68ff0fa6cf dirstate: preserve path components case on renames (issue3402)
The original issue was something like:

  $ hg init repo
  $ cd repo
  $ mkdir D
  $ echo a > D/a
  $ hg ci -Am adda
  adding D/a
  $ mv D temp
  $ mv temp d
  $ echo b > d/b
  $ hg add d/b
  adding D/b
  $ hg ci -m addb
  $ hg mv d/b d/c
  moving D/b to d/c
  $ hg st
  A d/c
  R D/b

Here we expected:

  A D/c
  R D/b

the logic being we try to preserve case of path components already known in the
dirstate. This is fixed by the current patch.

Note the following stories are not still not supported:

Changing directory case
  $ hg mv D d
  moving D/a to D/D/a
  moving D/b to D/D/b
  $ hg st
  A D/D/a
  A D/D/b
  R D/a
  R D/b

or:

  $ hg mv D/* d
  D/a: not overwriting - file exists
  D/b: not overwriting - file exists

And if they were, there are probably similar issues with diffing/patching.
2012-04-28 20:29:21 +02:00
Mads Kiilerich
8564a7de60 tests: quote dummyssh in a way that works on windows too
Don't depend on $environmentvariableexpansion and 'quote' handling in system()
2012-04-28 02:00:04 +02:00
Mads Kiilerich
d94d866bcb tests: add missing accept of native pathname separator 2012-04-28 01:55:39 +02:00
Mads Kiilerich
8639b8b9e3 tests: skip new tests with requirements not available on windows 2012-04-28 01:22:56 +02:00
Mads Kiilerich
df37dcb230 tests: don't require 'hg' without extension on windows
Hackable uses hg.exe instead.
2012-04-28 01:22:47 +02:00
Patrick Mezard
cc838630b9 commit: abort on merge with missing files
Here is a script illustrating the previous behaviour:

The merge brings a new file 'b' from remote
  $ hg merge 1 --debug
    searching for copies back to rev 1
    unmatched files in other:
     b
  resolving manifests
   overwrite: False, partial: False
   ancestor: 07f494440405, local: 540395c44225+, remote: 102a90ea7b4a
   b: remote created -> g
  updating: b 1/1 files (100.00%)
  getting b
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  (branch merge, don't forget to commit)

Delete but do not remove b
  $ rm b
  $ hg st
  ! b

The commit succeeds
  $ hg commit -m merge
  $ hg parents --template "{rev} {desc|firstline} files: {files}\n"
  3 merge files:
  $ hg st
  ! b

b changes were ignored, but even b existence was ignored
  $ hg manifest
  a

This happens because localrepo.commitctx() checks the input ctx.files(), which
is empty for workingctx.files() only returns added, modified or removed
entries, and bypass files/manifest updates completely. So the committed
revision manifest is the same as its first parent one, not containing the 'b'
file.

This patch forces the commit to abort in presence of a merge and missing files.
test-merge4.t is modified accordingly as it was introduced to check hg was not
just terminating with a traceback (5cc0d3ba11f9).
2012-04-28 15:01:57 +02:00
Mads Kiilerich
80eee013e1 tests: unify the last sh tests
This requires a slightly smarter check-code check for sed output filtering.
2012-04-25 01:35:39 +02:00