1#! /usr/bin/env python 2# Copyright (c) 2006 The Regents of The University of Michigan 3# Copyright (c) 2007 The Hewlett-Packard Development Company 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 89 unchanged lines hidden (view full) --- 98 99 lines = list(f) 100 101 f.seek(0) 102 f.truncate() 103 104 for i,line in enumerate(lines): 105 if fixonly is None or i in fixonly: |
106 line = fixwhite_line(line) |
107 108 print >>f, line, 109 110def linelen(line): 111 tabs = line.count('\t') 112 if not tabs: 113 return len(line) 114 --- 189 unchanged lines hidden (view full) --- 304 continue 305 306 ui.write("invalid whitespace: %s:%d\n" % (fname, i+1)) 307 if ui.verbose: 308 ui.write(">>%s<<\n" % line[:-1]) 309 fixonly.add(i) 310 311 if fixonly: |
312 if prompt(fname, fixwhite, fixonly): |
313 return True 314 315def do_check_format(ui, repo, **args): 316 modified, added, removed, deleted, unknown, ignore, clean = repo.status() 317 318 verbose = 0 319 stats = ValidationStats() 320 for f in modified + added: --- 113 unchanged lines hidden --- |