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