##// END OF EJS Templates
subrepo: handle missing subrepo spec file as removed...
Patrick Mezard -
r13017:d0e21c5f stable
parent child Browse files
Show More
@@ -0,0 +1,51 b''
1 $ hg init repo
2 $ cd repo
3 $ hg init subrepo
4 $ echo a > subrepo/a
5 $ hg -R subrepo ci -Am adda
6 adding a
7 $ echo 'subrepo = subrepo' > .hgsub
8 $ hg ci -Am addsubrepo
9 adding .hgsub
10 committing subrepository subrepo
11 $ echo b > subrepo/b
12 $ hg -R subrepo ci -Am addb
13 adding b
14 $ hg ci -m updatedsub
15 committing subrepository subrepo
16
17 delete .hgsub and revert it
18
19 $ rm .hgsub
20 $ hg revert .hgsub
21 warning: subrepo spec file .hgsub not found
22
23 delete .hgsubstate and revert it
24
25 $ rm .hgsubstate
26 $ hg revert .hgsubstate
27
28 delete .hgsub and update
29
30 $ rm .hgsub
31 $ hg up 0
32 warning: subrepo spec file .hgsub not found
33 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 $ hg st
35 ! .hgsub
36 $ ls subrepo
37 a
38
39 delete .hgsubstate and update
40
41 $ hg up -C
42 warning: subrepo spec file .hgsub not found
43 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 $ rm .hgsubstate
45 $ hg up 0
46 remote changed .hgsubstate which local deleted
47 use (c)hanged version or leave (d)eleted? c
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
49 $ hg st
50 $ ls subrepo
51 a
@@ -21,7 +21,15 b' def state(ctx, ui):'
21 21 p = config.config()
22 22 def read(f, sections=None, remap=None):
23 23 if f in ctx:
24 p.parse(f, ctx[f].data(), sections, remap, read)
24 try:
25 data = ctx[f].data()
26 except IOError, err:
27 if err.errno != errno.ENOENT:
28 raise
29 # handle missing subrepo spec files as removed
30 ui.warn(_("warning: subrepo spec file %s not found\n") % f)
31 return
32 p.parse(f, data, sections, remap, read)
25 33 else:
26 34 raise util.Abort(_("subrepo spec file %s not found") % f)
27 35
General Comments 0
You need to be logged in to leave comments. Login now