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