##// END OF EJS Templates
subrepo: precisely identify the missing subrepo spec file...
Matt Harbison -
r24645:b39afa36 default
parent child Browse files
Show More
@@ -70,11 +70,14 b' def state(ctx, ui):'
70 if err.errno != errno.ENOENT:
70 if err.errno != errno.ENOENT:
71 raise
71 raise
72 # handle missing subrepo spec files as removed
72 # handle missing subrepo spec files as removed
73 ui.warn(_("warning: subrepo spec file %s not found\n") % f)
73 ui.warn(_("warning: subrepo spec file \'%s\' not found\n") %
74 util.pathto(ctx.repo().root, ctx.repo().getcwd(), f))
74 return
75 return
75 p.parse(f, data, sections, remap, read)
76 p.parse(f, data, sections, remap, read)
76 else:
77 else:
77 raise util.Abort(_("subrepo spec file %s not found") % f)
78 repo = ctx.repo()
79 raise util.Abort(_("subrepo spec file \'%s\' not found") %
80 util.pathto(repo.root, repo.getcwd(), f))
78
81
79 if '.hgsub' in ctx:
82 if '.hgsub' in ctx:
80 read('.hgsub')
83 read('.hgsub')
@@ -92,9 +95,11 b' def state(ctx, ui):'
92 try:
95 try:
93 revision, path = l.split(" ", 1)
96 revision, path = l.split(" ", 1)
94 except ValueError:
97 except ValueError:
98 repo = ctx.repo()
95 raise util.Abort(_("invalid subrepository revision "
99 raise util.Abort(_("invalid subrepository revision "
96 "specifier in .hgsubstate line %d")
100 "specifier in \'%s\' line %d")
97 % (i + 1))
101 % (util.pathto(repo.root, repo.getcwd(),
102 '.hgsubstate'), (i + 1)))
98 rev[path] = revision
103 rev[path] = revision
99 except IOError, err:
104 except IOError, err:
100 if err.errno != errno.ENOENT:
105 if err.errno != errno.ENOENT:
@@ -299,7 +299,7 b' handle subrepos safely on qrecord'
299 +sub = sub
299 +sub = sub
300 record this change to '.hgsub'? [Ynesfdaq?] y
300 record this change to '.hgsub'? [Ynesfdaq?] y
301
301
302 warning: subrepo spec file .hgsub not found
302 warning: subrepo spec file '.hgsub' not found
303 abort: uncommitted changes in subrepository 'sub'
303 abort: uncommitted changes in subrepository 'sub'
304 [255]
304 [255]
305 % update substate when adding .hgsub w/clean updated subrepo
305 % update substate when adding .hgsub w/clean updated subrepo
@@ -313,7 +313,7 b' handle subrepos safely on qrecord'
313 +sub = sub
313 +sub = sub
314 record this change to '.hgsub'? [Ynesfdaq?] y
314 record this change to '.hgsub'? [Ynesfdaq?] y
315
315
316 warning: subrepo spec file .hgsub not found
316 warning: subrepo spec file '.hgsub' not found
317 path sub
317 path sub
318 source sub
318 source sub
319 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
319 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
@@ -141,9 +141,14 b' Check that deep archiving works'
141 $ hg status -S
141 $ hg status -S
142 $ hg remove sub1/sub2/folder/test.txt
142 $ hg remove sub1/sub2/folder/test.txt
143 $ hg remove sub1/.hgsubstate
143 $ hg remove sub1/.hgsubstate
144 $ mv sub1/.hgsub sub1/x.hgsub
144 $ hg status -S
145 $ hg status -S
146 warning: subrepo spec file 'sub1/.hgsub' not found (glob)
145 R sub1/.hgsubstate
147 R sub1/.hgsubstate
146 R sub1/sub2/folder/test.txt
148 R sub1/sub2/folder/test.txt
149 ! sub1/.hgsub
150 ? sub1/x.hgsub
151 $ mv sub1/x.hgsub sub1/.hgsub
147 $ hg update -Cq
152 $ hg update -Cq
148 $ touch sub1/foo
153 $ touch sub1/foo
149 $ hg forget sub1/sub2/folder/test.txt
154 $ hg forget sub1/sub2/folder/test.txt
@@ -24,7 +24,7 b' abort more gracefully on .hgsubstate par'
24 $ cp .hgsubstate .hgsubstate.old
24 $ cp .hgsubstate .hgsubstate.old
25 >>> file('.hgsubstate', 'wb').write('\ninvalid')
25 >>> file('.hgsubstate', 'wb').write('\ninvalid')
26 $ hg st --subrepos
26 $ hg st --subrepos
27 abort: invalid subrepository revision specifier in .hgsubstate line 2
27 abort: invalid subrepository revision specifier in '.hgsubstate' line 2
28 [255]
28 [255]
29 $ mv .hgsubstate.old .hgsubstate
29 $ mv .hgsubstate.old .hgsubstate
30
30
@@ -32,9 +32,9 b' delete .hgsub and revert it'
32
32
33 $ rm .hgsub
33 $ rm .hgsub
34 $ hg revert .hgsub
34 $ hg revert .hgsub
35 warning: subrepo spec file .hgsub not found
35 warning: subrepo spec file '.hgsub' not found
36 warning: subrepo spec file .hgsub not found
36 warning: subrepo spec file '.hgsub' not found
37 warning: subrepo spec file .hgsub not found
37 warning: subrepo spec file '.hgsub' not found
38
38
39 delete .hgsubstate and revert it
39 delete .hgsubstate and revert it
40
40
@@ -45,11 +45,11 b' delete .hgsub and update'
45
45
46 $ rm .hgsub
46 $ rm .hgsub
47 $ hg up 0
47 $ hg up 0
48 warning: subrepo spec file .hgsub not found
48 warning: subrepo spec file '.hgsub' not found
49 warning: subrepo spec file .hgsub not found
49 warning: subrepo spec file '.hgsub' not found
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 $ hg st
51 $ hg st
52 warning: subrepo spec file .hgsub not found
52 warning: subrepo spec file '.hgsub' not found
53 ! .hgsub
53 ! .hgsub
54 $ ls subrepo
54 $ ls subrepo
55 a
55 a
@@ -57,8 +57,8 b' delete .hgsub and update'
57 delete .hgsubstate and update
57 delete .hgsubstate and update
58
58
59 $ hg up -C
59 $ hg up -C
60 warning: subrepo spec file .hgsub not found
60 warning: subrepo spec file '.hgsub' not found
61 warning: subrepo spec file .hgsub not found
61 warning: subrepo spec file '.hgsub' not found
62 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 $ rm .hgsubstate
63 $ rm .hgsubstate
64 $ hg up 0
64 $ hg up 0
General Comments 0
You need to be logged in to leave comments. Login now