Mercurial > public > mercurial-scm > hg-stable
diff tests/test-merge-subrepos.t @ 33364:bf2daeddd42b
subrepo: consider the parent repo dirty when a file is missing
This simply passes the 'missing' argument down from the context of the parent
repo, so the same rules apply. subrepo.bailifchanged() is hardcoded to care
about missing files, because cmdutil.bailifchanged() is too.
In the end, it looks like this addresses inconsistencies with 'archive',
'identify', blackbox logs, 'merge', and 'update --check'. I wasn't sure how to
implement this in git, so that's left for someone more familiar with it.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 09 Jul 2017 02:55:46 -0400 |
parents | 583aa1e3658b |
children | 6d88468d435b |
line wrap: on
line diff
--- a/tests/test-merge-subrepos.t Sun Jul 09 02:46:03 2017 -0400 +++ b/tests/test-merge-subrepos.t Sun Jul 09 02:55:46 2017 -0400 @@ -55,13 +55,13 @@ $ rm subrepo/b -TODO: a deleted subrepo file should be flagged as dirty, like the top level repo +A deleted subrepo file is flagged as dirty, like the top level repo $ hg id --config extensions.blackbox= --config blackbox.dirty=True - 9bfe45a197d7 tip + 9bfe45a197d7+ tip $ cat .hg/blackbox.log - * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5 (*)> id (glob) - * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5 (*)> id --config "extensions.blackbox=" --config "blackbox.dirty=True" exited 0 * (glob) + * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id (glob) + * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* exited 0 * (glob) TODO: a deleted file should be listed as such, like the top level repo @@ -99,10 +99,14 @@ $ hg st -S ! subrepo/b -TODO: --check should notice a subrepo with a missing file. It already notices -a modified file. +`hg update --check` notices a subrepo with a missing file, like it notices a +missing file in the top level repo. - $ hg up -r '.^' --check --config ui.interactive=True << EOF + $ hg up -r '.^' --check + abort: uncommitted changes in subrepository 'subrepo' + [255] + + $ hg up -r '.^' --config ui.interactive=True << EOF > c > EOF other [destination] changed b which local [working copy] deleted @@ -122,8 +126,5 @@ Merge sees deleted subrepo files as an uncommitted change $ hg merge @other - subrepository subrepo diverged (local revision: de222c2e1eac, remote revision: 7d3f8eba8116) - (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m - abort: uncommitted changes (in subrepo subrepo) - (use 'hg status' to list changes) + abort: uncommitted changes in subrepository 'subrepo' [255]