##// END OF EJS Templates
merge: make applyupdates() not mutate mresult argument...
Martin von Zweigbergk -
r48163:9e6e12e1 default
parent child Browse files
Show More
@@ -1724,20 +1724,13 b' def applyupdates('
1724 1724 removed += msremoved
1725 1725
1726 1726 extraactions = ms.actions()
1727 if extraactions:
1728 for k, acts in pycompat.iteritems(extraactions):
1729 for a in acts:
1730 mresult.addfile(a[0], k, *a[1:])
1731 if k == mergestatemod.ACTION_GET and wantfiledata:
1732 # no filedata until mergestate is updated to provide it
1733 for a in acts:
1734 getfiledata[a[0]] = None
1735 1727
1736 1728 progress.complete()
1737 assert len(getfiledata) == (
1738 mresult.len((mergestatemod.ACTION_GET,)) if wantfiledata else 0
1729 return (
1730 updateresult(updated, merged, removed, unresolved),
1731 getfiledata,
1732 extraactions,
1739 1733 )
1740 return updateresult(updated, merged, removed, unresolved), getfiledata
1741 1734
1742 1735
1743 1736 def _advertisefsmonitor(repo, num_gets, p1node):
@@ -2122,7 +2115,7 b' def _update('
2122 2115 )
2123 2116
2124 2117 wantfiledata = updatedirstate and not branchmerge
2125 stats, getfiledata = applyupdates(
2118 stats, getfiledata, extraactions = applyupdates(
2126 2119 repo,
2127 2120 mresult,
2128 2121 wc,
@@ -2133,6 +2126,18 b' def _update('
2133 2126 )
2134 2127
2135 2128 if updatedirstate:
2129 if extraactions:
2130 for k, acts in pycompat.iteritems(extraactions):
2131 for a in acts:
2132 mresult.addfile(a[0], k, *a[1:])
2133 if k == mergestatemod.ACTION_GET and wantfiledata:
2134 # no filedata until mergestate is updated to provide it
2135 for a in acts:
2136 getfiledata[a[0]] = None
2137
2138 assert len(getfiledata) == (
2139 mresult.len((mergestatemod.ACTION_GET,)) if wantfiledata else 0
2140 )
2136 2141 with repo.dirstate.parentchange():
2137 2142 repo.setparents(fp1, fp2)
2138 2143 mergestatemod.recordupdates(
General Comments 0
You need to be logged in to leave comments. Login now