Mercurial > hg
view tests/test-sparse-verbose-json.t @ 33331:4bae3c117b57
scmutil: make cleanupnodes delete divergent bookmarks
cleanupnodes takes care of bookmark movement, and bookmark movement could
cause bookmark divergent resolution as a side effect. This patch adds such
bookmark divergent resolution logic so future rebase migration will be
easier.
The revset is carefully written to be equivalent to what rebase does today.
Although I think it might make sense to remove divergent bookmarks more
aggressively, for example:
F book@1
|
E book@2
|
| D book
| |
| C
|/
B book@3
|
A
When rebase -s C -d E, "book@1" will be removed, "book@3" will be kept,
and the end result is:
D book
|
C
|
F
|
E book@2 (?)
|
B book@3
|
A
The question is should we keep book@2? The current logic keeps it. If we
choose not to (makes some sense to me), the "deleterevs" revset could be
simplified to "newnode % oldnode".
For now, I just make it compatible with the existing behavior. If we want to
make the "deleterevs" revset simpler, we can always do it in the future.
author | Jun Wu <quark@fb.com> |
---|---|
date | Mon, 26 Jun 2017 13:13:51 -0700 |
parents | c9cbf4de27ba |
children | 9087f9997f42 |
line wrap: on
line source
test sparse with --verbose and -T json $ hg init myrepo $ cd myrepo $ cat > .hg/hgrc <<EOF > [extensions] > sparse= > strip= > EOF $ echo a > show $ echo x > hide $ hg ci -Aqm 'initial' $ echo b > show $ echo y > hide $ echo aa > show2 $ echo xx > hide2 $ hg ci -Aqm 'two' Verify basic --include and --reset $ hg up -q 0 $ hg debugsparse --include 'hide' -Tjson [ { "exclude_rules_added": 0, "files_added": 0, "files_conflicting": 0, "files_dropped": 1, "include_rules_added": 1, "profiles_added": 0 } ] $ hg debugsparse --clear-rules $ hg debugsparse --include 'hide' --verbose removing show Profile # change: 0 Include rule # change: 1 Exclude rule # change: 0 $ hg debugsparse --reset -Tjson [ { "exclude_rules_added": 0, "files_added": 1, "files_conflicting": 0, "files_dropped": 0, "include_rules_added": -1, "profiles_added": 0 } ] $ hg debugsparse --include 'hide' $ hg debugsparse --reset --verbose getting show Profile # change: 0 Include rule # change: -1 Exclude rule # change: 0 Verifying that problematic files still allow us to see the deltas when forcing: $ hg debugsparse --include 'show*' $ touch hide $ hg debugsparse --delete 'show*' --force -Tjson pending changes to 'hide' [ { "exclude_rules_added": 0, "files_added": 0, "files_conflicting": 1, "files_dropped": 0, "include_rules_added": -1, "profiles_added": 0 } ] $ hg debugsparse --include 'show*' --force pending changes to 'hide' $ hg debugsparse --delete 'show*' --force --verbose pending changes to 'hide' Profile # change: 0 Include rule # change: -1 Exclude rule # change: 0