changeset 101:a3b717e4abf5

Cleanups based on pyflakes output.
author Augie Fackler <durin42@gmail.com>
date Fri, 21 Nov 2008 16:21:19 -0600
parents 91ce18fa0375
children 3d56b8c53979
files fetch_command.py tests/test_fetch_command.py tests/test_fetch_renames.py tests/test_fetch_symlinks.py tests/test_push_command.py tests/test_tags.py utility_commands.py
diffstat 7 files changed, 11 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/fetch_command.py
+++ b/fetch_command.py
@@ -1,6 +1,5 @@
 import cStringIO
 import re
-import operator
 import os
 import shutil
 import tempfile
@@ -124,7 +123,7 @@ def replay_convert_rev(hg_editor, svn, r
             hg_editor.ui.flush()
             if p[-1] == '/':
                 dirpath = p[len(rootpath):]
-                files_to_grab.update((dirpath + f for f,k in 
+                files_to_grab.update((dirpath + f for f,k in
                                       svn.list_files(p, r.revnum) if k == 'f'))
             else:
                 files_to_grab.add(p[len(rootpath):])
@@ -207,7 +206,7 @@ def makecopyfinder(r, branchpath, rootdi
     copies.sort()
     copies.reverse()
     exactcopies = dict(copies)
-    
+
     def finder(path):
         if path in exactcopies:
             return exactcopies[path], exactcopies[path][0]
@@ -280,9 +279,9 @@ def stupid_fetch_branchrev(svn, hg_edito
         # Branch does not exist at this revision. Get parent revision and
         # remove everything.
         files = parentctx.manifest().keys()
-        def filectxfn(repo, memctx, path):
+        def filectxfn_rm(repo, memctx, path):
             raise IOError()
-        return files, filectxfn
+        return files, filectxfn_rm
 
     files = []
     if parentid == revlog.nullid:
@@ -314,10 +313,10 @@ def stupid_fetch_branchrev(svn, hg_edito
                 # Assume it's a deleted directory
                 path = path + '/'
                 deleted = [f for f in parentctx if f.startswith(path)]
-                files += deleted        
+                files += deleted
 
     copies = getcopies(svn, hg_editor, branch, branchpath, r, files, parentid)
-    
+
     def filectxfn(repo, memctx, path):
         data, mode = svn.get_file(branchpath + '/' + path, r.revnum)
         isexec = 'x' in mode
@@ -516,7 +515,7 @@ def stupid_svn_server_pull_rev(ui, svn, 
                     if p:
                         files_touched.add(p)
 
-            copies = getcopies(svn, hg_editor, b, branches[b], r, files_touched, 
+            copies = getcopies(svn, hg_editor, b, branches[b], r, files_touched,
                                parent_ha)
 
             def filectxfn(repo, memctx, path):
--- a/tests/test_fetch_command.py
+++ b/tests/test_fetch_command.py
@@ -1,12 +1,9 @@
-import os
-import tempfile
 import unittest
 
 from mercurial import hg
 from mercurial import ui
 from mercurial import node
 
-import fetch_command
 import test_util
 
 
--- a/tests/test_fetch_renames.py
+++ b/tests/test_fetch_renames.py
@@ -1,14 +1,6 @@
-import os
-import shutil
 import sys
-import tempfile
 import unittest
 
-from mercurial import hg
-from mercurial import ui
-from mercurial import node
-
-import fetch_command
 import test_util
 
 
--- a/tests/test_fetch_symlinks.py
+++ b/tests/test_fetch_symlinks.py
@@ -1,14 +1,5 @@
-import os
-import shutil
-import sys
-import tempfile
 import unittest
 
-from mercurial import hg
-from mercurial import ui
-from mercurial import node
-
-import fetch_command
 import test_util
 
 
--- a/tests/test_push_command.py
+++ b/tests/test_push_command.py
@@ -1,11 +1,9 @@
 import os
 import socket
 import subprocess
-import tempfile
 import unittest
 
 from mercurial import context
-from mercurial import commands
 from mercurial import hg
 from mercurial import node
 from mercurial import ui
@@ -300,7 +298,7 @@ class PushTests(test_util.TestBase):
         # while we're here, double check pushing an already-executable file
         # works
         repo = self.repo
-        def file_callback(repo, memctx, path):
+        def file_callback2(repo, memctx, path):
             return context.memfilectx(path=path,
                                       data='bar',
                                       islink=link,
@@ -310,7 +308,7 @@ class PushTests(test_util.TestBase):
                              (repo['default'].node(), node.nullid),
                              'message',
                              ['alpha', ],
-                             file_callback,
+                             file_callback2,
                              'author',
                              '2008-1-1 00:00:00 -0500',
                              {'branch': 'default', })
@@ -324,7 +322,7 @@ class PushTests(test_util.TestBase):
         self.assertEqual(tip['alpha'].flags(), expected_flags)
         # now test removing the property entirely
         repo = self.repo
-        def file_callback(repo, memctx, path):
+        def file_callback3(repo, memctx, path):
             return context.memfilectx(path=path,
                                       data='bar',
                                       islink=False,
@@ -334,7 +332,7 @@ class PushTests(test_util.TestBase):
                              (repo['default'].node(), node.nullid),
                              'message',
                              ['alpha', ],
-                             file_callback,
+                             file_callback3,
                              'author',
                              '2008-01-01 00:00:00 -0500',
                              {'branch': 'default', })
--- a/tests/test_tags.py
+++ b/tests/test_tags.py
@@ -1,5 +1,3 @@
-import os
-import tempfile
 import unittest
 
 from mercurial import hg
--- a/utility_commands.py
+++ b/utility_commands.py
@@ -1,4 +1,3 @@
-from mercurial import context
 from mercurial import cmdutil
 from mercurial import node
 from mercurial import util as mutil