Mercurial > hg
annotate tests/test-journal-exists.t @ 18796:fa6d5c62f3bd
pathcomplete: complete directories more conservatively
Suppose we want to perform a single-level completion (i.e. without
--full) of "fi" in a repo containing "fee", "fie/dead", "fie/live",
and "foe".
If we give back "fie/" as the only answer, the shell will consider
the completion to be unambiguous, and will append a space after the
completion. We can't complete "fie/live" or "fie/dead" without
first backspacing over that space.
We used to thus create two fake names, "fie/a" and "fie/b", to force
the shell to consider the completion to be ambiguous. It would then
stop at "fie/" without appending a space, allowing us to hit tab
again to complete "fie/live" or "fie/dead".
The change here arises from realising that we only need to force
the shell to consider a completion as ambiguous if we have exactly
one directory and zero files as possible completions.
This prevents spurious names from showing up as possible completions
when they don't need to be invented in the first place.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Thu, 21 Mar 2013 22:10:54 -0700 |
parents | acba1281e064 |
children | e54a078153f7 |
rev | line source |
---|---|
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
1 $ hg init |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
2 $ echo a > a |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
3 $ hg ci -Am0 |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
4 adding a |
5865
e7127f669edb
transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
5 |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
6 $ hg -q clone . foo |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
7 |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
8 $ touch .hg/store/journal |
5865
e7127f669edb
transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
9 |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
10 $ echo foo > a |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
11 $ hg ci -Am0 |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
12 abort: abandoned transaction found - run hg recover! |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12205
diff
changeset
|
13 [255] |
5865
e7127f669edb
transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
14 |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
15 $ hg recover |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
16 rolling back interrupted transaction |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
17 checking changesets |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
18 checking manifests |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
19 crosschecking files in changesets and manifests |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
20 checking files |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
21 1 files, 1 changesets, 1 total revisions |
5865
e7127f669edb
transactions: don't show a backtrace when journal exists
Matt Mackall <mpm@selenic.com>
parents:
diff
changeset
|
22 |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
23 Check that zero-size journals are correctly aborted: |
9693
c40a1ee20aa5
transaction: always remove empty journal on abort
Sune Foldager <cryo@cyanite.org>
parents:
5867
diff
changeset
|
24 |
16959
acba1281e064
test-journal-exists: use #if
Adrian Buehlmann <adrian@cadifra.com>
parents:
15443
diff
changeset
|
25 #if unix-permissions |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
26 $ hg bundle -qa repo.hg |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
27 $ chmod -w foo/.hg/store/00changelog.i |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
28 |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
29 $ hg -R foo unbundle repo.hg |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
30 adding changesets |
12640
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12376
diff
changeset
|
31 abort: Permission denied: $TESTTMP/foo/.hg/store/.00changelog.i-* (glob) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12205
diff
changeset
|
32 [255] |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
33 |
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
34 $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi |
16959
acba1281e064
test-journal-exists: use #if
Adrian Buehlmann <adrian@cadifra.com>
parents:
15443
diff
changeset
|
35 #endif |
12205
b4d0d646b3f7
tests: unify test-journal-exists
Adrian Buehlmann <adrian@cadifra.com>
parents:
9693
diff
changeset
|
36 |