Show More
@@ -576,6 +576,8 b' def _dispatch(ui, args):' | |||
|
576 | 576 | if not repo.local(): |
|
577 | 577 | raise util.Abort(_("repository '%s' is not local") % path) |
|
578 | 578 | ui.setconfig("bundle", "mainreporoot", repo.root) |
|
579 | except error.RequirementError: | |
|
580 | raise | |
|
579 | 581 | except error.RepoError: |
|
580 | 582 | if cmd not in commands.optionalrepo.split(): |
|
581 | 583 | if args and not path: # try to infer -R from command args |
@@ -51,6 +51,10 b' class RepoLookupError(RepoError):' | |||
|
51 | 51 | class CapabilityError(RepoError): |
|
52 | 52 | pass |
|
53 | 53 | |
|
54 | class RequirementError(RepoError): | |
|
55 | """Exception raised if .hg/requires has an unknown entry.""" | |
|
56 | pass | |
|
57 | ||
|
54 | 58 | class LockError(IOError): |
|
55 | 59 | def __init__(self, errno, strerror, filename, desc): |
|
56 | 60 | IOError.__init__(self, errno, strerror, filename) |
@@ -75,7 +75,8 b' class localrepository(repo.repository):' | |||
|
75 | 75 | if inst.errno != errno.ENOENT: |
|
76 | 76 | raise |
|
77 | 77 | for r in requirements - self.supported: |
|
78 |
raise error.Re |
|
|
78 | raise error.RequirementError( | |
|
79 | _("requirement '%s' not supported") % r) | |
|
79 | 80 | |
|
80 | 81 | self.sharedpath = self.path |
|
81 | 82 | try: |
@@ -112,7 +112,8 b' class statichttprepository(localrepo.loc' | |||
|
112 | 112 | # check them |
|
113 | 113 | for r in requirements: |
|
114 | 114 | if r not in self.supported: |
|
115 |
raise error.Re |
|
|
115 | raise error.RequirementError( | |
|
116 | _("requirement '%s' not supported") % r) | |
|
116 | 117 | |
|
117 | 118 | # setup store |
|
118 | 119 | self.store = store.store(requirements, self.path, opener) |
@@ -92,6 +92,15 b' An empty date was interpreted as epoch o' | |||
|
92 | 92 | $ hg commit -d '' -m commit-no-date |
|
93 | 93 | $ hg tip --template '{date|isodate}\n' | grep '1970' |
|
94 | 94 | [1] |
|
95 | ||
|
96 | Make sure we do not obscure unknown requires file entries (issue2649) | |
|
97 | ||
|
98 | $ echo foo >> foo | |
|
99 | $ echo fake >> .hg/requires | |
|
100 | $ hg commit -m bla | |
|
101 | abort: requirement 'fake' not supported! | |
|
102 | [255] | |
|
103 | ||
|
95 | 104 | $ cd .. |
|
96 | 105 | |
|
97 | 106 |
@@ -67,3 +67,16 b' remote with tags?' | |||
|
67 | 67 | $ hg id -t http://localhost:$HGPORT1/ |
|
68 | 68 | abort: can't query remote revision number, branch, or tags |
|
69 | 69 | [255] |
|
70 | ||
|
71 | Make sure we do not obscure unknown requires file entries (issue2649) | |
|
72 | ||
|
73 | $ echo fake >> .hg/requires | |
|
74 | $ hg id | |
|
75 | abort: requirement 'fake' not supported! | |
|
76 | [255] | |
|
77 | ||
|
78 | $ cd .. | |
|
79 | $ hg id test | |
|
80 | abort: requirement 'fake' not supported! | |
|
81 | [255] | |
|
82 |
General Comments 0
You need to be logged in to leave comments.
Login now