From 026c0689b2a70875f48c8933298ef2ae8e4eae7c Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Mon, 23 Jan 2006 17:37:31 +0000 Subject: [PATCH] Allow patch refreshing for some files only The patch allows the 'refresh' command to accept files as arguments. Only the local changes to the specified files will be considered for inclusion in the patch to be refreshed. Signed-off-by: Catalin Marinas --- stgit/commands/refresh.py | 8 +++----- stgit/stack.py | 6 ++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stgit/commands/refresh.py b/stgit/commands/refresh.py index 48b406a..20b7546 100644 --- a/stgit/commands/refresh.py +++ b/stgit/commands/refresh.py @@ -26,7 +26,7 @@ from stgit.config import config help = 'generate a new commit for the current patch' -usage = """%prog [options] +usage = """%prog [options] [] Include the latest tree changes in the current patch. This command generates a new GIT commit object with the patch details, the previous @@ -66,9 +66,6 @@ options = [make_option('-f', '--force', def func(parser, options, args): - if len(args) != 0: - parser.error('incorrect number of arguments') - if config.has_option('stgit', 'autoresolved'): autoresolved = config.get('stgit', 'autoresolved') else: @@ -97,7 +94,8 @@ def func(parser, options, args): if autoresolved == 'yes': resolved_all() - crt_series.refresh_patch(message = options.message, + crt_series.refresh_patch(files = args, + message = options.message, edit = options.edit, show_patch = options.showpatch, author_name = options.authname, diff --git a/stgit/stack.py b/stgit/stack.py index c2adeb9..b081c95 100644 --- a/stgit/stack.py +++ b/stgit/stack.py @@ -476,7 +476,8 @@ class Series: if os.path.exists(self.__base_file): os.remove(self.__base_file) - def refresh_patch(self, message = None, edit = False, show_patch = False, + def refresh_patch(self, files = None, message = None, edit = False, + show_patch = False, cache_update = True, author_name = None, author_email = None, author_date = None, @@ -512,7 +513,8 @@ class Series: if not committer_email: committer_email = patch.get_commemail() - commit_id = git.commit(message = descr, parents = [patch.get_bottom()], + commit_id = git.commit(files = files, + message = descr, parents = [patch.get_bottom()], cache_update = cache_update, allowempty = True, author_name = author_name, -- 2.11.0