Mercurial > hg
diff hgext/record.py @ 6600:b822a379860b
match: stop passing files through commitfunc
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 12 May 2008 11:37:08 -0500 |
parents | e75aab656f46 |
children | a57a27b12965 |
line wrap: on
line diff
--- a/hgext/record.py Mon May 12 11:37:08 2008 -0500 +++ b/hgext/record.py Mon May 12 11:37:08 2008 -0500 @@ -389,7 +389,7 @@ if not ui.interactive: raise util.Abort(_('running non-interactively, use commit instead')) - def recordfunc(ui, repo, files, message, match, opts): + def recordfunc(ui, repo, message, match, opts): """This is generic record driver. It's job is to interactively filter local changes, and accordingly @@ -402,15 +402,15 @@ In the end we'll record intresting changes, and everything else will be left in place, so the user can continue his work. """ - if files: + if match.files(): changes = None else: - changes = repo.status(files=files, match=match)[:5] + changes = repo.status(match=match)[:5] modified, added, removed = changes[:3] - files = modified + added + removed + match = cmdutil.matchfiles(repo, modified + added + removed) diffopts = mdiff.diffopts(git=True, nodates=True) fp = cStringIO.StringIO() - patch.diff(repo, repo.dirstate.parents()[0], files=files, + patch.diff(repo, repo.dirstate.parents()[0], files=match.files(), match=match, changes=changes, opts=diffopts, fp=fp) fp.seek(0) @@ -423,14 +423,15 @@ try: contenders.update(dict.fromkeys(h.files())) except AttributeError: pass - newfiles = [f for f in files if f in contenders] + newfiles = [f for f in match.files() if f in contenders] if not newfiles: ui.status(_('no changes to record\n')) return 0 if changes is None: - changes = repo.status(files=newfiles, match=match)[:5] + match = cmdutil.matchfiles(repo, newfiles) + changes = repo.status(files=match.files(), match=match)[:5] modified = dict.fromkeys(changes[0]) # 2. backup changed files, so we can restore them in the end