##// END OF EJS Templates
record: minimize number of status calls
Dirkjan Ochtman -
r7754:ab00d2c2 default
parent child Browse files
Show More
@@ -406,15 +406,10 b' def dorecord(ui, repo, committer, *pats,'
406 406 In the end we'll record intresting changes, and everything else will be
407 407 left in place, so the user can continue his work.
408 408 """
409 if match.files():
410 changes = None
411 else:
412 changes = repo.status(match=match)[:3]
413 modified, added, removed = changes
414 match = cmdutil.matchfiles(repo, modified + added + removed)
409
410 changes = repo.status(match=match)[:3]
415 411 diffopts = mdiff.diffopts(git=True, nodates=True)
416 chunks = patch.diff(repo, repo.dirstate.parents()[0], match=match,
417 changes=changes, opts=diffopts)
412 chunks = patch.diff(repo, changes=changes, opts=diffopts)
418 413 fp = cStringIO.StringIO()
419 414 fp.write(''.join(chunks))
420 415 fp.seek(0)
@@ -428,15 +423,12 b' def dorecord(ui, repo, committer, *pats,'
428 423 try: contenders.update(dict.fromkeys(h.files()))
429 424 except AttributeError: pass
430 425
431 newfiles = [f for f in match.files() if f in contenders]
432
426 changed = changes[0] + changes[1] + changes[2]
427 newfiles = [f for f in changed if f in contenders]
433 428 if not newfiles:
434 429 ui.status(_('no changes to record\n'))
435 430 return 0
436 431
437 if changes is None:
438 match = cmdutil.matchfiles(repo, newfiles)
439 changes = repo.status(match=match)
440 432 modified = dict.fromkeys(changes[0])
441 433
442 434 # 2. backup changed files, so we can restore them in the end
General Comments 0
You need to be logged in to leave comments. Login now