From: Jeremy Kerr Date: Wed, 10 Sep 2008 02:02:50 +0000 (+1000) Subject: Allow rehash for specific patches X-Git-Url: https://git.ozlabs.org/?p=patchwork;a=commitdiff_plain;h=a2d3b37e2fb9255486cdfdab13646cc9814eef97 Allow rehash for specific patches Signed-off-by: Jeremy Kerr --- 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()