From a2d3b37e2fb9255486cdfdab13646cc9814eef97 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Wed, 10 Sep 2008 12:02:50 +1000 Subject: [PATCH] Allow rehash for specific patches Signed-off-by: Jeremy Kerr --- apps/patchwork/bin/rehash.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/patchwork/bin/rehash.py b/apps/patchwork/bin/rehash.py index 1b3e3e9..92cfb20 100755 --- a/apps/patchwork/bin/rehash.py +++ b/apps/patchwork/bin/rehash.py @@ -20,9 +20,15 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from patchwork.models import Patch +import sys if __name__ == '__main__': - for patch in Patch.objects.all(): + if len(sys.argv) > 1: + patches = Patch.objects.filter(id__in = sys.argv[1:]) + else: + patches = Patch.objects.all() + + for patch in patches: print patch.id, patch.name patch.hash = None patch.save() -- 2.39.2