Show More
@@ -384,9 +384,13 b' def update(repo, node, branchmerge, forc' | |||||
384 | if branchmerge: |
|
384 | if branchmerge: | |
385 | raise util.Abort(_("there is nothing to merge, just use " |
|
385 | raise util.Abort(_("there is nothing to merge, just use " | |
386 | "'hg update' or look at 'hg heads'")) |
|
386 | "'hg update' or look at 'hg heads'")) | |
387 |
elif not |
|
387 | elif not branchmerge: | |
388 | raise util.Abort(_("update spans branches, use 'hg merge' " |
|
388 | if not overwrite: | |
389 | "or 'hg update -C' to lose changes")) |
|
389 | if wc.files(): | |
|
390 | raise util.Abort(_("outstanding uncommited changes, use " | |||
|
391 | "'hg update -C' to lose changes")) | |||
|
392 | else: | |||
|
393 | overwrite = True | |||
390 | if branchmerge and not forcemerge: |
|
394 | if branchmerge and not forcemerge: | |
391 | if wc.modified() or wc.added() or wc.removed(): |
|
395 | if wc.modified() or wc.added() or wc.removed(): | |
392 | raise util.Abort(_("outstanding uncommitted changes")) |
|
396 | raise util.Abort(_("outstanding uncommitted changes")) |
@@ -12,9 +12,13 b' hg commit -m"comment #1" -d "1000000 0"' | |||||
12 | hg update 0 |
|
12 | hg update 0 | |
13 | rm b |
|
13 | rm b | |
14 | hg commit -A -m"comment #2" -d "1000000 0" |
|
14 | hg commit -A -m"comment #2" -d "1000000 0" | |
|
15 | ||||
|
16 | echo This is file a > a | |||
15 | # in theory, we shouldn't need the "-y" below, but it prevents |
|
17 | # in theory, we shouldn't need the "-y" below, but it prevents | |
16 | # this test from hanging when "hg update" erroneously prompts the |
|
18 | # this test from hanging when "hg update" erroneously prompts the | |
17 | # user for "keep or delete" |
|
19 | # user for "keep or delete" | |
|
20 | hg update -y 1 # should fail (unclean repo) | |||
|
21 | hg revert a | |||
18 | hg update -y 1 |
|
22 | hg update -y 1 | |
19 |
|
23 | |||
20 | exit 0 |
|
24 | exit 0 |
@@ -1,3 +1,4 b'' | |||||
1 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
2 | removing b |
|
2 | removing b | |
3 |
abort: |
|
3 | abort: outstanding uncommited changes, use 'hg update -C' to lose changes | |
|
4 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
@@ -93,7 +93,7 b' user: test' | |||||
93 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
93 | date: Mon Jan 12 13:46:40 1970 +0000 | |
94 | summary: 2 |
|
94 | summary: 2 | |
95 |
|
95 | |||
96 |
abort: |
|
96 | abort: outstanding uncommited changes, use 'hg update -C' to lose changes | |
97 | failed |
|
97 | failed | |
98 | abort: outstanding uncommitted changes |
|
98 | abort: outstanding uncommitted changes | |
99 | failed |
|
99 | failed |
General Comments 0
You need to be logged in to leave comments.
Login now