changeset 15170:c1a4a3220711

largefiles: fix over-long lines
author Matt Mackall <mpm@selenic.com>
date Thu, 29 Sep 2011 17:04:57 -0500
parents aa262fff87ac
children 547da6115d1d
files hgext/largefiles/lfcommands.py hgext/largefiles/lfutil.py hgext/largefiles/overrides.py hgext/largefiles/proto.py hgext/largefiles/reposetup.py hgext/largefiles/uisetup.py
diffstat 6 files changed, 47 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/lfcommands.py	Thu Sep 29 16:48:48 2011 -0500
+++ b/hgext/largefiles/lfcommands.py	Thu Sep 29 17:04:57 2011 -0500
@@ -39,8 +39,8 @@
             try:
                 size = int(size)
             except ValueError:
-                raise util.Abort(_('largefiles.size must be integer, was %s\n') % \
-                    size)
+                raise util.Abort(_('largefiles.size must be integer, was %s\n')
+                                 % size)
             except TypeError:
                 raise util.Abort(_('size must be specified'))
 
@@ -232,7 +232,8 @@
                 if 'l' in fctx.flags():
                     if renamedlfile:
                         raise util.Abort(
-                            _('Renamed/copied largefile %s becomes symlink') % f)
+                            _('Renamed/copied largefile %s becomes symlink')
+                            % f)
                     islfile = False
             if islfile:
                 lfiles.add(f)
@@ -341,10 +342,12 @@
     at = 0
     files = filter(lambda h: not store.exists(h), files)
     for hash in files:
-        ui.progress(_('uploading largefiles'), at, unit='largefile', total=len(files))
+        ui.progress(_('uploading largefiles'), at, unit='largefile',
+                    total=len(files))
         source = lfutil.findfile(rsrc, hash)
         if not source:
-            raise util.Abort(_('Missing largefile %s needs to be uploaded') % hash)
+            raise util.Abort(_('Missing largefile %s needs to be uploaded')
+                             % hash)
         # XXX check for errors here
         store.put(source, hash)
         at += 1
@@ -475,8 +478,8 @@
 cmdtable = {
     'lfconvert': (lfconvert,
                   [('s', 'size', 0, 'All files over this size (in megabytes) '
-                  'will be considered largefiles. This can also be specified in '
-                  'your hgrc as [largefiles].size.'),
+                  'will be considered largefiles. This can also be specified '
+                  'in your hgrc as [largefiles].size.'),
                   ('','tonormal',False,
                       'Convert from a largefiles repo to a normal repo')],
                   _('hg lfconvert SOURCE DEST [FILE ...]')),
--- a/hgext/largefiles/lfutil.py	Thu Sep 29 16:48:48 2011 -0500
+++ b/hgext/largefiles/lfutil.py	Thu Sep 29 17:04:57 2011 -0500
@@ -488,8 +488,8 @@
     return os.path.normpath(path).replace(os.sep, '/')
 
 def islfilesrepo(repo):
-    return 'largefiles' in repo.requirements and any_(shortname+'/' in f[0] for f in
-        repo.store.datafiles())
+    return ('largefiles' in repo.requirements and
+            any_(shortname + '/' in f[0] for f in repo.store.datafiles())
 
 def any_(gen):
     for x in gen:
--- a/hgext/largefiles/overrides.py	Thu Sep 29 16:48:48 2011 -0500
+++ b/hgext/largefiles/overrides.py	Thu Sep 29 17:04:57 2011 -0500
@@ -87,7 +87,8 @@
         try:
             lfsize = int(lfsize)
         except ValueError:
-            raise util.Abort(_('largefiles: size must be an integer, was %s\n') % lfsize)
+            raise util.Abort(_('largefiles: size must be an integer, was %s\n')
+                             % lfsize)
 
     lfmatcher = None
     if os.path.exists(repo.wjoin(lfutil.shortname)):
@@ -530,7 +531,8 @@
         finally:
             restorematchfn()
         lfileslist = getattr(repo, '_lfilestoupdate', [])
-        lfcommands.updatelfiles(ui, repo, filelist=lfileslist, printmessage=False)
+        lfcommands.updatelfiles(ui, repo, filelist=lfileslist,
+                                printmessage=False)
         # Empty out the lfiles list so we start fresh next time
         repo._lfilestoupdate = []
         for lfile in modified:
--- a/hgext/largefiles/proto.py	Thu Sep 29 16:48:48 2011 -0500
+++ b/hgext/largefiles/proto.py	Thu Sep 29 17:04:57 2011 -0500
@@ -105,7 +105,8 @@
             try:
                 length = int(length)
             except ValueError:
-                self._abort(error.ResponseError(_("unexpected response:"), length))
+                self._abort(error.ResponseError(_("unexpected response:"),
+                                                length))
             return (length, stream)
 
         def statlfile(self, sha):
--- a/hgext/largefiles/reposetup.py	Thu Sep 29 16:48:48 2011 -0500
+++ b/hgext/largefiles/reposetup.py	Thu Sep 29 17:04:57 2011 -0500
@@ -58,8 +58,8 @@
                 class lfiles_ctx(ctx.__class__):
                     def files(self):
                         filenames = super(lfiles_ctx, self).files()
-                        return [re.sub('^\\'+lfutil.shortname+'/', '', filename) for filename
-                            in filenames]
+                        return [re.sub('^\\'+lfutil.shortname+'/', '',
+                                       filename) for filename in filenames]
                     def manifest(self):
                         man1 = super(lfiles_ctx, self).manifest()
                         man1.__class__ = lfiles_manifestdict
--- a/hgext/largefiles/uisetup.py	Thu Sep 29 16:48:48 2011 -0500
+++ b/hgext/largefiles/uisetup.py	Thu Sep 29 17:04:57 2011 -0500
@@ -20,7 +20,8 @@
     # Disable auto-status for some commands which assume that all
     # files in the result are under Mercurial's control
 
-    entry = extensions.wrapcommand(commands.table, 'add', overrides.override_add)
+    entry = extensions.wrapcommand(commands.table, 'add',
+                                   overrides.override_add)
     addopt = [('', 'large', None, _('add as largefile')),
             ('', 'lfsize', '', _('add all files above this size (in megabytes)'
                                  'as largefiles (default: 10)'))]
@@ -28,14 +29,19 @@
 
     entry = extensions.wrapcommand(commands.table, 'addremove',
             overrides.override_addremove)
-    entry = extensions.wrapcommand(commands.table, 'remove', overrides.override_remove)
-    entry = extensions.wrapcommand(commands.table, 'forget', overrides.override_forget)
-    entry = extensions.wrapcommand(commands.table, 'status', overrides.override_status)
-    entry = extensions.wrapcommand(commands.table, 'log', overrides.override_log)
+    entry = extensions.wrapcommand(commands.table, 'remove',
+                                   overrides.override_remove)
+    entry = extensions.wrapcommand(commands.table, 'forget',
+                                   overrides.override_forget)
+    entry = extensions.wrapcommand(commands.table, 'status',
+                                   overrides.override_status)
+    entry = extensions.wrapcommand(commands.table, 'log',
+                                   overrides.override_log)
     entry = extensions.wrapcommand(commands.table, 'rollback',
-            overrides.override_rollback)
+                                   overrides.override_rollback)
+    entry = extensions.wrapcommand(commands.table, 'verify',
+                                   overrides.override_verify)
 
-    entry = extensions.wrapcommand(commands.table, 'verify', overrides.override_verify)
     verifyopt = [('', 'large', None, _('verify largefiles')),
                  ('', 'lfa', None,
                      _('verify all revisions of largefiles not just current')),
@@ -47,19 +53,26 @@
         overrides.override_outgoing)
     outgoingopt = [('', 'large', None, _('display outgoing largefiles'))]
     entry[1].extend(outgoingopt)
-    entry = extensions.wrapcommand(commands.table, 'summary', overrides.override_summary)
+    entry = extensions.wrapcommand(commands.table, 'summary',
+                                   overrides.override_summary)
     summaryopt = [('', 'large', None, _('display outgoing largefiles'))]
     entry[1].extend(summaryopt)
 
-    entry = extensions.wrapcommand(commands.table, 'update', overrides.override_update)
-    entry = extensions.wrapcommand(commands.table, 'pull', overrides.override_pull)
-    entry = extensions.wrapfunction(filemerge, 'filemerge', overrides.override_filemerge)
-    entry = extensions.wrapfunction(cmdutil, 'copy', overrides.override_copy)
+    entry = extensions.wrapcommand(commands.table, 'update',
+                                   overrides.override_update)
+    entry = extensions.wrapcommand(commands.table, 'pull',
+                                   overrides.override_pull)
+    entry = extensions.wrapfunction(filemerge, 'filemerge',
+                                    overrides.override_filemerge)
+    entry = extensions.wrapfunction(cmdutil, 'copy',
+                                    overrides.override_copy)
 
     # Backout calls revert so we need to override both the command and the
     # function
-    entry = extensions.wrapcommand(commands.table, 'revert', overrides.override_revert)
-    entry = extensions.wrapfunction(commands, 'revert', overrides.override_revert)
+    entry = extensions.wrapcommand(commands.table, 'revert',
+                                   overrides.override_revert)
+    entry = extensions.wrapfunction(commands, 'revert',
+                                    overrides.override_revert)
 
     # clone uses hg._update instead of hg.update even though they are the
     # same function... so wrap both of them)