Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 26547:b9be8ab6e628
patch: move 'extract' return to a dictionnary
The final goal here is to be able to parse, return and process arbitrary data
from patch. This mirror the recently added ability to add arbitrary data to
patch headers.
The first step is to return something more flexible, so we return a dict without
changing any other logic.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 06 Oct 2015 02:01:53 -0700 |
parents | e99c3846d78a |
children | 1f14920a892c |
comparison
equal
deleted
inserted
replaced
26546:500386e65759 | 26547:b9be8ab6e628 |
---|---|
848 :updatefunc: a function that update a repo to a given node | 848 :updatefunc: a function that update a repo to a given node |
849 updatefunc(<repo>, <node>) | 849 updatefunc(<repo>, <node>) |
850 """ | 850 """ |
851 # avoid cycle context -> subrepo -> cmdutil | 851 # avoid cycle context -> subrepo -> cmdutil |
852 import context | 852 import context |
853 tmpname, message, user, date, branch, nodeid, p1, p2 = \ | 853 extractdata = patch.extract(ui, hunk) |
854 patch.extract(ui, hunk) | 854 tmpname = extractdata.get('filename') |
855 message = extractdata.get('message') | |
856 user = extractdata.get('user') | |
857 date = extractdata.get('date') | |
858 branch = extractdata.get('branch') | |
859 nodeid = extractdata.get('nodeid') | |
860 p1 = extractdata.get('p1') | |
861 p2 = extractdata.get('p2') | |
855 | 862 |
856 update = not opts.get('bypass') | 863 update = not opts.get('bypass') |
857 strip = opts["strip"] | 864 strip = opts["strip"] |
858 prefix = opts["prefix"] | 865 prefix = opts["prefix"] |
859 sim = float(opts.get('similarity') or 0) | 866 sim = float(opts.get('similarity') or 0) |