##// END OF EJS Templates
cmdutil: simplify duplicatecopies
Matt Mackall -
r15777:12309c09 default
parent child Browse files
Show More
@@ -269,7 +269,7 b' def rebase(ui, repo, **opts):'
269 'resolve, then hg rebase --continue)'))
269 'resolve, then hg rebase --continue)'))
270 finally:
270 finally:
271 ui.setconfig('ui', 'forcemerge', '')
271 ui.setconfig('ui', 'forcemerge', '')
272 cmdutil.duplicatecopies(repo, rev, target, p2)
272 cmdutil.duplicatecopies(repo, rev, target)
273 if not collapsef:
273 if not collapsef:
274 newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn,
274 newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn,
275 editor=editor)
275 editor=editor)
@@ -1198,18 +1198,10 b' def add(ui, repo, match, dryrun, listsub'
1198 bad.extend(f for f in rejected if f in match.files())
1198 bad.extend(f for f in rejected if f in match.files())
1199 return bad
1199 return bad
1200
1200
1201 def duplicatecopies(repo, rev, p1, p2):
1201 def duplicatecopies(repo, rev, p1):
1202 "Reproduce copies found in the source revision in the dirstate for grafts"
1202 "Reproduce copies found in the source revision in the dirstate for grafts"
1203 # Here we simulate the copies and renames in the source changeset
1203 for dst, src in copies.pathcopies(repo[p1], repo[rev]).iteritems():
1204 cop, diver = copies.mergecopies(repo, repo[rev], repo[p1], repo[p2])
1204 repo.dirstate.copy(src, dst)
1205 m1 = repo[rev].manifest()
1206 m2 = repo[p1].manifest()
1207 for k, v in cop.iteritems():
1208 if k in m1:
1209 if v in m1 or v in m2:
1210 repo.dirstate.copy(v, k)
1211 if v in m2 and v not in m1 and k in m2:
1212 repo.dirstate.remove(v)
1213
1205
1214 def commit(ui, repo, commitfunc, pats, opts):
1206 def commit(ui, repo, commitfunc, pats, opts):
1215 '''commit the specified files or all outstanding changes'''
1207 '''commit the specified files or all outstanding changes'''
@@ -2627,7 +2627,7 b' def graft(ui, repo, *revs, **opts):'
2627 repo.dirstate.setparents(current.node(), nullid)
2627 repo.dirstate.setparents(current.node(), nullid)
2628 repo.dirstate.write()
2628 repo.dirstate.write()
2629 # fix up dirstate for copies and renames
2629 # fix up dirstate for copies and renames
2630 cmdutil.duplicatecopies(repo, ctx.rev(), current.node(), nullid)
2630 cmdutil.duplicatecopies(repo, ctx.rev(), current.node())
2631 # report any conflicts
2631 # report any conflicts
2632 if stats and stats[3] > 0:
2632 if stats and stats[3] > 0:
2633 # write out state for --continue
2633 # write out state for --continue
@@ -106,14 +106,6 b' Graft out of order, skipping a merge and'
106 b: local copied/moved to a -> m
106 b: local copied/moved to a -> m
107 preserving b for resolve of b
107 preserving b for resolve of b
108 updating: b 1/1 files (100.00%)
108 updating: b 1/1 files (100.00%)
109 searching for copies back to rev 1
110 unmatched files in local:
111 a
112 unmatched files in other:
113 b
114 all copies found (* = to merge, ! = divergent):
115 b -> a *
116 checking for directory renames
117 b
109 b
118 b: searching for copy revision for a
110 b: searching for copy revision for a
119 b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
111 b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
@@ -127,12 +119,6 b' Graft out of order, skipping a merge and'
127 e: remote is newer -> g
119 e: remote is newer -> g
128 updating: e 1/1 files (100.00%)
120 updating: e 1/1 files (100.00%)
129 getting e
121 getting e
130 searching for copies back to rev 1
131 unmatched files in local:
132 c
133 all copies found (* = to merge, ! = divergent):
134 c -> b *
135 checking for directory renames
136 e
122 e
137 grafting revision 4
123 grafting revision 4
138 searching for copies back to rev 1
124 searching for copies back to rev 1
@@ -152,12 +138,6 b' Graft out of order, skipping a merge and'
152 my e@77eb504366ab+ other e@9c233e8e184d ancestor e@68795b066622
138 my e@77eb504366ab+ other e@9c233e8e184d ancestor e@68795b066622
153 warning: conflicts during merge.
139 warning: conflicts during merge.
154 merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
140 merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
155 searching for copies back to rev 1
156 unmatched files in local:
157 c
158 all copies found (* = to merge, ! = divergent):
159 c -> b *
160 checking for directory renames
161 abort: unresolved conflicts, can't continue
141 abort: unresolved conflicts, can't continue
162 (use hg resolve and hg graft --continue)
142 (use hg resolve and hg graft --continue)
163 [255]
143 [255]
General Comments 0
You need to be logged in to leave comments. Login now