Show More
@@ -43,11 +43,16 b' def state(ctx, ui):' | |||
|
43 | 43 | rev = {} |
|
44 | 44 | if '.hgsubstate' in ctx: |
|
45 | 45 | try: |
|
46 | for l in ctx['.hgsubstate'].data().splitlines(): | |
|
46 | for i, l in enumerate(ctx['.hgsubstate'].data().splitlines()): | |
|
47 | 47 | l = l.lstrip() |
|
48 | 48 | if not l: |
|
49 | 49 | continue |
|
50 | revision, path = l.split(" ", 1) | |
|
50 | try: | |
|
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 | 56 | rev[path] = revision |
|
52 | 57 | except IOError, err: |
|
53 | 58 | if err.errno != errno.ENOENT: |
@@ -19,6 +19,15 b' ignore blanklines in .hgsubstate' | |||
|
19 | 19 | M .hgsubstate |
|
20 | 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 | 31 | delete .hgsub and revert it |
|
23 | 32 | |
|
24 | 33 | $ rm .hgsub |
General Comments 0
You need to be logged in to leave comments.
Login now