Mercurial > hg
annotate tests/test-addremove.t @ 33377:5d63e5f40bea
revset: define successors revset
This revset returns all successors, including transit nodes and the source
nodes (to be consistent with existing revsets like "ancestors").
To filter out transit nodes, use `successors(X)-obsolete()`.
To filter out divergent case, use `successors(X)-divergent()-obsolete()`.
The revset could be useful to define rebase destination, like:
`max(successors(BASE)-divergent()-obsolete())`. The `max` is to deal with
splits.
There are other implementations where `successors` returns just one level of
successors, and `allsuccessors` returns everything. I think `successors`
returning all successors by default is more user friendly. We have seen
cases in production where people use 1-level `successors` while they really
want `allsuccessors`. So it seems better to just have one single revset
returning all successors by default to avoid user errors.
In the future we might want to add `depth` keyword argument to it and for
other revsets like `ancestors` etc. Or even build some flexible indexing
syntax [1] to satisfy people having the depth limit requirement.
[1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-July/101140.html
author | Jun Wu <quark@fb.com> |
---|---|
date | Mon, 10 Jul 2017 10:56:40 -0700 |
parents | dd050fc04cc9 |
children | feecfefeba25 |
rev | line source |
---|---|
11850
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
1 $ hg init rep |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
2 $ cd rep |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
3 $ mkdir dir |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
4 $ touch foo dir/bar |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
5 $ hg -v addremove |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
6 adding dir/bar |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
7 adding foo |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11850
diff
changeset
|
8 $ hg -v commit -m "add 1" |
23749
a387b0390082
localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents:
23535
diff
changeset
|
9 committing files: |
11850
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
10 dir/bar |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
11 foo |
23749
a387b0390082
localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents:
23535
diff
changeset
|
12 committing manifest |
a387b0390082
localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents:
23535
diff
changeset
|
13 committing changelog |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11850
diff
changeset
|
14 committed changeset 0:6f7f953567a2 |
11850
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
15 $ cd dir/ |
16874
8017ac7a0e8f
test-addremove: remove bits about con.xml
Adrian Buehlmann <adrian@cadifra.com>
parents:
15444
diff
changeset
|
16 $ touch ../foo_2 bar_2 |
11850
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
17 $ hg -v addremove |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
18 adding dir/bar_2 |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
19 adding foo_2 |
12156
4c94b6d0fb1c
tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents:
11850
diff
changeset
|
20 $ hg -v commit -m "add 2" |
23749
a387b0390082
localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents:
23535
diff
changeset
|
21 committing files: |
11850
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
22 dir/bar_2 |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
23 foo_2 |
23749
a387b0390082
localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents:
23535
diff
changeset
|
24 committing manifest |
a387b0390082
localrepo: show headline notes in commitctx before showing filenames
Mads Kiilerich <madski@unity3d.com>
parents:
23535
diff
changeset
|
25 committing changelog |
16874
8017ac7a0e8f
test-addremove: remove bits about con.xml
Adrian Buehlmann <adrian@cadifra.com>
parents:
15444
diff
changeset
|
26 committed changeset 1:e65414bf35c5 |
23259
9f4778027bc2
addremove: add back forgotten files (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
16912
diff
changeset
|
27 $ cd .. |
9f4778027bc2
addremove: add back forgotten files (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
16912
diff
changeset
|
28 $ hg forget foo |
9f4778027bc2
addremove: add back forgotten files (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
16912
diff
changeset
|
29 $ hg -v addremove |
9f4778027bc2
addremove: add back forgotten files (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
16912
diff
changeset
|
30 adding foo |
23534
83bbedc16b3f
addremove: warn when addremove fails to operate on a named path
Matt Harbison <matt_harbison@yahoo.com>
parents:
23427
diff
changeset
|
31 $ hg forget foo |
33340
dd050fc04cc9
test-addremove: conditionalize output instead of tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
24180
diff
changeset
|
32 |
24180
d8e0c591781c
spelling: fixes from proofreading of spell checker issues
Mads Kiilerich <madski@unity3d.com>
parents:
23749
diff
changeset
|
33 $ hg -v addremove nonexistent |
33340
dd050fc04cc9
test-addremove: conditionalize output instead of tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
24180
diff
changeset
|
34 nonexistent: The system cannot find the file specified (windows !) |
dd050fc04cc9
test-addremove: conditionalize output instead of tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
24180
diff
changeset
|
35 nonexistent: No such file or directory (no-windows !) |
23534
83bbedc16b3f
addremove: warn when addremove fails to operate on a named path
Matt Harbison <matt_harbison@yahoo.com>
parents:
23427
diff
changeset
|
36 [1] |
33340
dd050fc04cc9
test-addremove: conditionalize output instead of tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
24180
diff
changeset
|
37 |
23259
9f4778027bc2
addremove: add back forgotten files (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
16912
diff
changeset
|
38 $ cd .. |
2958
ff3ea21a981a
addremove: add -s/--similarity option
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
1933
diff
changeset
|
39 |
23427
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
40 $ hg init subdir |
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
41 $ cd subdir |
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
42 $ mkdir dir |
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
43 $ cd dir |
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
44 $ touch a.py |
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
45 $ hg addremove 'glob:*.py' |
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
46 adding a.py |
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
47 $ hg forget a.py |
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
48 $ hg addremove -I 'glob:*.py' |
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
49 adding a.py |
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
50 $ hg forget a.py |
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
51 $ hg addremove |
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
52 adding dir/a.py |
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
53 $ cd .. |
3778884197f0
addremove: print relative paths when called with -I/-X (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
23259
diff
changeset
|
54 |
11850
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
55 $ hg init sim |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
56 $ cd sim |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
57 $ echo a > a |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
58 $ echo a >> a |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
59 $ echo a >> a |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
60 $ echo c > c |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
61 $ hg commit -Ama |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
62 adding a |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
63 adding c |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
64 $ mv a b |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
65 $ rm c |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
66 $ echo d > d |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
67 $ hg addremove -n -s 50 # issue 1696 |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
68 removing a |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
69 adding b |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
70 removing c |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
71 adding d |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
72 recording removal of a as rename to b (100% similar) |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
73 $ hg addremove -s 50 |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
74 removing a |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
75 adding b |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
76 removing c |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
77 adding d |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
78 recording removal of a as rename to b (100% similar) |
54dbf16b401f
tests: unify test-addremove
Martin Geisler <mg@lazybytes.net>
parents:
8990
diff
changeset
|
79 $ hg commit -mb |
23259
9f4778027bc2
addremove: add back forgotten files (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
16912
diff
changeset
|
80 $ cp b c |
9f4778027bc2
addremove: add back forgotten files (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
16912
diff
changeset
|
81 $ hg forget b |
9f4778027bc2
addremove: add back forgotten files (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
16912
diff
changeset
|
82 $ hg addremove -s 50 |
9f4778027bc2
addremove: add back forgotten files (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
16912
diff
changeset
|
83 adding b |
9f4778027bc2
addremove: add back forgotten files (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
16912
diff
changeset
|
84 adding c |
23535
72c23fa4f52f
commit: abort if --addremove is specified, but fails
Matt Harbison <matt_harbison@yahoo.com>
parents:
23534
diff
changeset
|
85 |
72c23fa4f52f
commit: abort if --addremove is specified, but fails
Matt Harbison <matt_harbison@yahoo.com>
parents:
23534
diff
changeset
|
86 $ rm c |
33340
dd050fc04cc9
test-addremove: conditionalize output instead of tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
24180
diff
changeset
|
87 |
24180
d8e0c591781c
spelling: fixes from proofreading of spell checker issues
Mads Kiilerich <madski@unity3d.com>
parents:
23749
diff
changeset
|
88 $ hg ci -A -m "c" nonexistent |
33340
dd050fc04cc9
test-addremove: conditionalize output instead of tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
24180
diff
changeset
|
89 nonexistent: The system cannot find the file specified (windows !) |
dd050fc04cc9
test-addremove: conditionalize output instead of tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
24180
diff
changeset
|
90 nonexistent: No such file or directory (no-windows !) |
23535
72c23fa4f52f
commit: abort if --addremove is specified, but fails
Matt Harbison <matt_harbison@yahoo.com>
parents:
23534
diff
changeset
|
91 abort: failed to mark all new/missing files as added/removed |
72c23fa4f52f
commit: abort if --addremove is specified, but fails
Matt Harbison <matt_harbison@yahoo.com>
parents:
23534
diff
changeset
|
92 [255] |
33340
dd050fc04cc9
test-addremove: conditionalize output instead of tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
24180
diff
changeset
|
93 |
23535
72c23fa4f52f
commit: abort if --addremove is specified, but fails
Matt Harbison <matt_harbison@yahoo.com>
parents:
23534
diff
changeset
|
94 $ hg st |
72c23fa4f52f
commit: abort if --addremove is specified, but fails
Matt Harbison <matt_harbison@yahoo.com>
parents:
23534
diff
changeset
|
95 ! c |
16912
6ef3107c661e
tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents:
16874
diff
changeset
|
96 $ cd .. |