##// END OF EJS Templates
subrepo: backout f02d7a562a21...
Erik Zielke -
r13172:84cec589 default
parent child Browse files
Show More
@@ -949,7 +949,6 b' class localrepository(repo.repository):'
949
949
950 # commit subs
950 # commit subs
951 if subs or removedsubs:
951 if subs or removedsubs:
952 pstate = subrepo.substate(self['.'])
953 state = wctx.substate.copy()
952 state = wctx.substate.copy()
954 for s in sorted(subs):
953 for s in sorted(subs):
955 sub = wctx.sub(s)
954 sub = wctx.sub(s)
@@ -957,19 +956,7 b' class localrepository(repo.repository):'
957 subrepo.subrelpath(sub))
956 subrepo.subrelpath(sub))
958 sr = sub.commit(cctx._text, user, date)
957 sr = sub.commit(cctx._text, user, date)
959 state[s] = (state[s][0], sr)
958 state[s] = (state[s][0], sr)
960
959 subrepo.writestate(self, state)
961 changed = False
962 if len(pstate) != len(state):
963 changed = True
964 if not changed:
965 for newstate in state:
966 if state[newstate][1] != pstate[newstate]:
967 changed = True
968 if changed:
969 subrepo.writestate(self, state)
970 elif (changes[0] == ['.hgsubstate'] and changes[1] == [] and
971 changes[2] == []):
972 return None
973
960
974 # Save commit message in case this transaction gets rolled back
961 # Save commit message in case this transaction gets rolled back
975 # (e.g. by a pretxncommit hook). Leave the content alone on
962 # (e.g. by a pretxncommit hook). Leave the content alone on
@@ -13,19 +13,6 b' hg = None'
13
13
14 nullstate = ('', '', 'empty')
14 nullstate = ('', '', 'empty')
15
15
16
17 def substate(ctx):
18 rev = {}
19 if '.hgsubstate' in ctx:
20 try:
21 for l in ctx['.hgsubstate'].data().splitlines():
22 revision, path = l.split(" ", 1)
23 rev[path] = revision
24 except IOError, err:
25 if err.errno != errno.ENOENT:
26 raise
27 return rev
28
29 def state(ctx, ui):
16 def state(ctx, ui):
30 """return a state dict, mapping subrepo paths configured in .hgsub
17 """return a state dict, mapping subrepo paths configured in .hgsub
31 to tuple: (source from .hgsub, revision from .hgsubstate, kind
18 to tuple: (source from .hgsub, revision from .hgsubstate, kind
@@ -52,7 +39,15 b' def state(ctx, ui):'
52 for path, src in ui.configitems('subpaths'):
39 for path, src in ui.configitems('subpaths'):
53 p.set('subpaths', path, src, ui.configsource('subpaths', path))
40 p.set('subpaths', path, src, ui.configsource('subpaths', path))
54
41
55 rev = substate(ctx)
42 rev = {}
43 if '.hgsubstate' in ctx:
44 try:
45 for l in ctx['.hgsubstate'].data().splitlines():
46 revision, path = l.split(" ", 1)
47 rev[path] = revision
48 except IOError, err:
49 if err.errno != errno.ENOENT:
50 raise
56
51
57 state = {}
52 state = {}
58 for path, src in p[''].items():
53 for path, src in p[''].items():
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now