##// END OF EJS Templates
subrepo: do not traceback on .hgsubstate parsing errors...
Patrick Mezard -
r16596:95ca6c8b stable
parent child Browse files
Show More
@@ -43,11 +43,16 def state(ctx, ui):
43 rev = {}
43 rev = {}
44 if '.hgsubstate' in ctx:
44 if '.hgsubstate' in ctx:
45 try:
45 try:
46 for l in ctx['.hgsubstate'].data().splitlines():
46 for i, l in enumerate(ctx['.hgsubstate'].data().splitlines()):
47 l = l.lstrip()
47 l = l.lstrip()
48 if not l:
48 if not l:
49 continue
49 continue
50 try:
50 revision, path = l.split(" ", 1)
51 revision, path = l.split(" ", 1)
52 except ValueError:
53 raise util.Abort(_("invalid subrepository revision "
54 "specifier in .hgsubstate line %d")
55 % (i + 1))
51 rev[path] = revision
56 rev[path] = revision
52 except IOError, err:
57 except IOError, err:
53 if err.errno != errno.ENOENT:
58 if err.errno != errno.ENOENT:
@@ -19,6 +19,15 ignore blanklines in .hgsubstate
19 M .hgsubstate
19 M .hgsubstate
20 $ hg revert -qC .hgsubstate
20 $ hg revert -qC .hgsubstate
21
21
22 abort more gracefully on .hgsubstate parsing error
23
24 $ cp .hgsubstate .hgsubstate.old
25 >>> file('.hgsubstate', 'wb').write('\ninvalid')
26 $ hg st --subrepos
27 abort: invalid subrepository revision specifier in .hgsubstate line 2
28 [255]
29 $ mv .hgsubstate.old .hgsubstate
30
22 delete .hgsub and revert it
31 delete .hgsub and revert it
23
32
24 $ rm .hgsub
33 $ rm .hgsub
General Comments 0
You need to be logged in to leave comments. Login now