Show More
@@ -389,7 +389,7 b' def dorecord(ui, repo, committer, *pats,' | |||
|
389 | 389 | if not ui.interactive: |
|
390 | 390 | raise util.Abort(_('running non-interactively, use commit instead')) |
|
391 | 391 | |
|
392 |
def recordfunc(ui, repo, |
|
|
392 | def recordfunc(ui, repo, message, match, opts): | |
|
393 | 393 | """This is generic record driver. |
|
394 | 394 | |
|
395 | 395 | It's job is to interactively filter local changes, and accordingly |
@@ -402,15 +402,15 b' def dorecord(ui, repo, committer, *pats,' | |||
|
402 | 402 | In the end we'll record intresting changes, and everything else will be |
|
403 | 403 | left in place, so the user can continue his work. |
|
404 | 404 | """ |
|
405 | if files: | |
|
405 | if match.files(): | |
|
406 | 406 | changes = None |
|
407 | 407 | else: |
|
408 |
changes = repo.status( |
|
|
408 | changes = repo.status(match=match)[:5] | |
|
409 | 409 | modified, added, removed = changes[:3] |
|
410 |
|
|
|
410 | match = cmdutil.matchfiles(repo, modified + added + removed) | |
|
411 | 411 | diffopts = mdiff.diffopts(git=True, nodates=True) |
|
412 | 412 | fp = cStringIO.StringIO() |
|
413 | patch.diff(repo, repo.dirstate.parents()[0], files=files, | |
|
413 | patch.diff(repo, repo.dirstate.parents()[0], files=match.files(), | |
|
414 | 414 | match=match, changes=changes, opts=diffopts, fp=fp) |
|
415 | 415 | fp.seek(0) |
|
416 | 416 | |
@@ -423,14 +423,15 b' def dorecord(ui, repo, committer, *pats,' | |||
|
423 | 423 | try: contenders.update(dict.fromkeys(h.files())) |
|
424 | 424 | except AttributeError: pass |
|
425 | 425 | |
|
426 | newfiles = [f for f in files if f in contenders] | |
|
426 | newfiles = [f for f in match.files() if f in contenders] | |
|
427 | 427 | |
|
428 | 428 | if not newfiles: |
|
429 | 429 | ui.status(_('no changes to record\n')) |
|
430 | 430 | return 0 |
|
431 | 431 | |
|
432 | 432 | if changes is None: |
|
433 | changes = repo.status(files=newfiles, match=match)[:5] | |
|
433 | match = cmdutil.matchfiles(repo, newfiles) | |
|
434 | changes = repo.status(files=match.files(), match=match)[:5] | |
|
434 | 435 | modified = dict.fromkeys(changes[0]) |
|
435 | 436 | |
|
436 | 437 | # 2. backup changed files, so we can restore them in the end |
@@ -1183,6 +1183,6 b' def commit(ui, repo, commitfunc, pats, o' | |||
|
1183 | 1183 | raise util.Abort(_("file %s not tracked!") % rel) |
|
1184 | 1184 | m = matchfiles(repo, files) |
|
1185 | 1185 | try: |
|
1186 |
return commitfunc(ui, repo, |
|
|
1186 | return commitfunc(ui, repo, message, m, opts) | |
|
1187 | 1187 | except ValueError, inst: |
|
1188 | 1188 | raise util.Abort(str(inst)) |
@@ -562,9 +562,9 b' def commit(ui, repo, *pats, **opts):' | |||
|
562 | 562 | |
|
563 | 563 | See 'hg help dates' for a list of formats valid for -d/--date. |
|
564 | 564 | """ |
|
565 |
def commitfunc(ui, repo, |
|
|
566 |
return repo.commit(files, message, opts['user'], opts['date'], |
|
|
567 | force_editor=opts.get('force_editor')) | |
|
565 | def commitfunc(ui, repo, message, match, opts): | |
|
566 | return repo.commit(match.files(), message, opts['user'], opts['date'], | |
|
567 | match, force_editor=opts.get('force_editor')) | |
|
568 | 568 | |
|
569 | 569 | node = cmdutil.commit(ui, repo, commitfunc, pats, opts) |
|
570 | 570 | if not node: |
General Comments 0
You need to be logged in to leave comments.
Login now