##// END OF EJS Templates
merge: update some docstrings
Matt Mackall -
r3315:38be819a default
parent child Browse files
Show More
@@ -13,13 +13,9 b' demandload(globals(), "errno util os tem'
13 def filemerge(repo, fw, fo, wctx, mctx):
13 def filemerge(repo, fw, fo, wctx, mctx):
14 """perform a 3-way merge in the working directory
14 """perform a 3-way merge in the working directory
15
15
16 fw = filename in the working directory and first parent
16 fw = filename in the working directory
17 fo = filename in other parent
17 fo = filename in other parent
18 wctx, mctx = working and merge changecontexts
18 wctx, mctx = working and merge changecontexts
19
20 TODO:
21 if fw is copied in the working directory, we get confused
22 implement move and fd
23 """
19 """
24
20
25 def temp(prefix, ctx):
21 def temp(prefix, ctx):
@@ -64,9 +60,7 b' def filemerge(repo, fw, fo, wctx, mctx):'
64 return r
60 return r
65
61
66 def checkunknown(wctx, mctx):
62 def checkunknown(wctx, mctx):
67 """
63 "check for collisions between unknown files and files in mctx"
68 check for collisions between unknown files and files in m2
69 """
70 man = mctx.manifest()
64 man = mctx.manifest()
71 for f in wctx.unknown():
65 for f in wctx.unknown():
72 if f in man:
66 if f in man:
@@ -94,9 +88,7 b' def forgetremoved(wctx, mctx):'
94 return action
88 return action
95
89
96 def nonoverlap(d1, d2):
90 def nonoverlap(d1, d2):
97 """
91 "Return list of elements in d1 not in d2"
98 Return list of elements in d1 not in d2
99 """
100
92
101 l = []
93 l = []
102 for d in d1:
94 for d in d1:
@@ -107,9 +99,7 b' def nonoverlap(d1, d2):'
107 return l
99 return l
108
100
109 def findold(fctx, limit):
101 def findold(fctx, limit):
110 """
102 "find files that path was copied from, back to linkrev limit"
111 find files that path was copied from, back to linkrev limit
112 """
113
103
114 old = {}
104 old = {}
115 orig = fctx.path()
105 orig = fctx.path()
@@ -174,7 +164,10 b' def findcopies(repo, m1, m2, limit):'
174
164
175 def manifestmerge(repo, p1, p2, pa, overwrite, partial):
165 def manifestmerge(repo, p1, p2, pa, overwrite, partial):
176 """
166 """
177 Merge manifest m1 with m2 using ancestor ma and generate merge action list
167 Merge p1 and p2 with ancestor ma and generate merge action list
168
169 overwrite = whether we clobber working files
170 partial = function to filter file lists
178 """
171 """
179
172
180 repo.ui.note(_("resolving manifests\n"))
173 repo.ui.note(_("resolving manifests\n"))
@@ -275,6 +268,8 b' def manifestmerge(repo, p1, p2, pa, over'
275 return action
268 return action
276
269
277 def applyupdates(repo, action, wctx, mctx):
270 def applyupdates(repo, action, wctx, mctx):
271 "apply the merge action list to the working directory"
272
278 updated, merged, removed, unresolved = 0, 0, 0, 0
273 updated, merged, removed, unresolved = 0, 0, 0, 0
279 action.sort()
274 action.sort()
280 for a in action:
275 for a in action:
@@ -319,6 +314,8 b' def applyupdates(repo, action, wctx, mct'
319 return updated, merged, removed, unresolved
314 return updated, merged, removed, unresolved
320
315
321 def recordupdates(repo, action, branchmerge, mctx):
316 def recordupdates(repo, action, branchmerge, mctx):
317 "record merge actions to the dirstate"
318
322 for a in action:
319 for a in action:
323 f, m = a[:2]
320 f, m = a[:2]
324 if m == "r": # remove
321 if m == "r": # remove
@@ -357,6 +354,16 b' def recordupdates(repo, action, branchme'
357
354
358 def update(repo, node, branchmerge=False, force=False, partial=None,
355 def update(repo, node, branchmerge=False, force=False, partial=None,
359 wlock=None, show_stats=True, remind=True):
356 wlock=None, show_stats=True, remind=True):
357 """
358 Perform a merge between the working directory and the given node
359
360 branchmerge = whether to merge between branches
361 force = whether to force branch merging or file overwriting
362 partial = a function to filter file lists (dirstate not updated)
363 wlock = working dir lock, if already held
364 show_stats = whether to report merge statistics
365 remind = whether to remind about merge
366 """
360
367
361 if not wlock:
368 if not wlock:
362 wlock = repo.wlock()
369 wlock = repo.wlock()
General Comments 0
You need to be logged in to leave comments. Login now