##// END OF EJS Templates
subrepo: don't write .hgsubstate lines with empty subrepo state (issue4622)...
Matt Harbison -
r24858:a9993120 stable
parent child Browse files
Show More
@@ -153,7 +153,8 b' def state(ctx, ui):'
153
153
154 def writestate(repo, state):
154 def writestate(repo, state):
155 """rewrite .hgsubstate in (outer) repo with these subrepo states"""
155 """rewrite .hgsubstate in (outer) repo with these subrepo states"""
156 lines = ['%s %s\n' % (state[s][1], s) for s in sorted(state)]
156 lines = ['%s %s\n' % (state[s][1], s) for s in sorted(state)
157 if state[s][1] != nullstate[1]]
157 repo.wwrite('.hgsubstate', ''.join(lines), '')
158 repo.wwrite('.hgsubstate', ''.join(lines), '')
158
159
159 def submerge(repo, wctx, mctx, actx, overwrite):
160 def submerge(repo, wctx, mctx, actx, overwrite):
@@ -1026,6 +1026,45 b' Incoming and outgoing should not use the'
1026 no changes found
1026 no changes found
1027 [1]
1027 [1]
1028
1028
1029 Check that merge of a new subrepo doesn't write the uncommitted state to
1030 .hgsubstate (issue4622)
1031
1032 $ hg init issue1852a/addedsub
1033 $ echo zzz > issue1852a/addedsub/zz.txt
1034 $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ"
1035
1036 $ hg clone issue1852a/addedsub issue1852d/addedsub
1037 updating to branch default
1038 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1039
1040 $ echo def > issue1852a/sub/repo/foo
1041 $ hg -R issue1852a ci -SAm 'tweaked subrepo'
1042 adding tmp/sub/repo/foo_p
1043 committing subrepository sub/repo (glob)
1044
1045 $ echo 'addedsub = addedsub' >> issue1852d/.hgsub
1046 $ echo xyz > issue1852d/sub/repo/foo
1047 $ hg -R issue1852d pull -u
1048 pulling from $TESTTMP/issue1852a (glob)
1049 searching for changes
1050 adding changesets
1051 adding manifests
1052 adding file changes
1053 added 1 changesets with 2 changes to 2 files
1054 subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c)
1055 (M)erge, keep (l)ocal or keep (r)emote? m
1056 pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo (glob)
1057 searching for changes
1058 adding changesets
1059 adding manifests
1060 adding file changes
1061 added 1 changesets with 1 changes to 1 files
1062 subrepository sources for sub/repo differ (glob)
1063 use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c)? l
1064 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1065 $ cat issue1852d/.hgsubstate
1066 f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo
1067
1029 Check status of files when none of them belong to the first
1068 Check status of files when none of them belong to the first
1030 subrepository:
1069 subrepository:
1031
1070
General Comments 0
You need to be logged in to leave comments. Login now