diff options
| -rw-r--r-- | scripts/lib/devtool/standard.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 77a82d5590..711399a1fc 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
| @@ -809,22 +809,19 @@ def modify(args, config, basepath, workspace): | |||
| 809 | 809 | ||
| 810 | return 0 | 810 | return 0 |
| 811 | 811 | ||
| 812 | def _get_patchset_revs(args, srctree, recipe_path): | 812 | def _get_patchset_revs(srctree, recipe_path, initial_rev=None): |
| 813 | """Get initial and update rev of a recipe. These are the start point of the | 813 | """Get initial and update rev of a recipe. These are the start point of the |
| 814 | whole patchset and start point for the patches to be re-generated/updated. | 814 | whole patchset and start point for the patches to be re-generated/updated. |
| 815 | """ | 815 | """ |
| 816 | import bb | 816 | import bb |
| 817 | 817 | ||
| 818 | if args.initial_rev: | 818 | # Parse initial rev from recipe if not specified |
| 819 | return args.initial_rev, args.initial_rev | ||
| 820 | |||
| 821 | # Parse initial rev from recipe | ||
| 822 | commits = [] | 819 | commits = [] |
| 823 | initial_rev = None | ||
| 824 | with open(recipe_path, 'r') as f: | 820 | with open(recipe_path, 'r') as f: |
| 825 | for line in f: | 821 | for line in f: |
| 826 | if line.startswith('# initial_rev:'): | 822 | if line.startswith('# initial_rev:'): |
| 827 | initial_rev = line.split(':')[-1].strip() | 823 | if not initial_rev: |
| 824 | initial_rev = line.split(':')[-1].strip() | ||
| 828 | elif line.startswith('# commit:'): | 825 | elif line.startswith('# commit:'): |
| 829 | commits.append(line.split(':')[-1].strip()) | 826 | commits.append(line.split(':')[-1].strip()) |
| 830 | 827 | ||
| @@ -1123,7 +1120,7 @@ def _update_recipe_patch(args, config, workspace, srctree, rd, config_data): | |||
| 1123 | raise DevtoolError('unable to find workspace bbappend for recipe %s' % | 1120 | raise DevtoolError('unable to find workspace bbappend for recipe %s' % |
| 1124 | args.recipename) | 1121 | args.recipename) |
| 1125 | 1122 | ||
| 1126 | initial_rev, update_rev, changed_revs = _get_patchset_revs(args, srctree, append) | 1123 | initial_rev, update_rev, changed_revs = _get_patchset_revs(srctree, append, args.initial_rev) |
| 1127 | if not initial_rev: | 1124 | if not initial_rev: |
| 1128 | raise DevtoolError('Unable to find initial revision - please specify ' | 1125 | raise DevtoolError('Unable to find initial revision - please specify ' |
| 1129 | 'it with --initial-rev') | 1126 | 'it with --initial-rev') |
