comparison tests/test-simple-update.t @ 45827:8d72e29ad1e0

errors: introduce InputError and use it from commands and cmdutil This patch introduces a `InputError` class and replaces many uses of `error.Abort` by it in `commands` and `cmdutil`. This is a part of https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan. There will later be a different class for state errors (to raise e.g. when there's an unfinished operation). It's not always clear when one should report an input error and when it should be a state error. We can always adjust later if I got something wrong in this patch (but feel free to point out any you notice now). Differential Revision: https://phab.mercurial-scm.org/D9167
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 06 Oct 2020 22:36:15 -0700
parents 65960fe9a769
children 2f2682f40ea0
comparison
equal deleted inserted replaced
45826:21733e8c924f 45827:8d72e29ad1e0
53 53
54 update to rev 0 with a date 54 update to rev 0 with a date
55 55
56 $ hg upd -d foo 0 56 $ hg upd -d foo 0
57 abort: you can't specify a revision and a date 57 abort: you can't specify a revision and a date
58 [255] 58 [10]
59 59
60 update by date 60 update by date
61 61
62 $ hg update -d '<1970-01-01 00:00:02 +0000' 62 $ hg update -d '<1970-01-01 00:00:02 +0000'
63 found revision 1 from Thu Jan 01 00:00:01 1970 +0000 63 found revision 1 from Thu Jan 01 00:00:01 1970 +0000
69 found revision 0 from Thu Jan 01 00:00:00 1970 +0000 69 found revision 0 from Thu Jan 01 00:00:00 1970 +0000
70 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 70 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
71 71
72 $ hg update -d '>1970-01-01 00:00:02 +0000' 72 $ hg update -d '>1970-01-01 00:00:02 +0000'
73 abort: revision matching date not found 73 abort: revision matching date not found
74 [255] 74 [10]
75 $ hg update -d '>1970-01-01 00:00:01 +0000' 75 $ hg update -d '>1970-01-01 00:00:01 +0000'
76 found revision 1 from Thu Jan 01 00:00:01 1970 +0000 76 found revision 1 from Thu Jan 01 00:00:01 1970 +0000
77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 $ hg update -d '>1970-01-01 00:00:00 +0000' 78 $ hg update -d '>1970-01-01 00:00:00 +0000'
79 found revision 1 from Thu Jan 01 00:00:01 1970 +0000 79 found revision 1 from Thu Jan 01 00:00:01 1970 +0000