Commits

Vadim Fint  committed 0f936e5

Remove a lot of bad whitespace in hgshelve.py

  • Participants
  • Parent commits e8674d5

Comments (0)

Files changed (1)

             else:
                 consumed.append(chunks.pop())
         return consumed
-    
+
     resp_all = [None]
 
-    """ If we're not to prompt (i.e. they specified the --all flag) 
+    """ If we're not to prompt (i.e. they specified the --all flag)
         we pre-emptively set the 'all' flag """
     if shouldprompt == False:
         resp_all = ['y']
-    
+
     resp_file = [None]
     applied = {}
     def prompt(query):
                        _(' and ').join(map(repr, chunk.files())))
             else:
                 r = 'y'
-            
+
             if r == 'y':
                 applied[chunk.filename()] = [chunk]
                 if chunk.allhunks():
             shelfpath = 'shelve'
         else:
             shelfpath = "shelves/default"
-    
+
     return shelfpath
-    
+
 def shelve(ui, repo, *pats, **opts):
     '''interactively select changes to set aside
 
         return
 
     forced = opts['force'] or opts['append']
-    
+
     # Shelf name and path
     shelfname = opts.get('name')
     shelfpath = getshelfpath(repo, shelfname)
-    
+
     if os.path.exists(repo.join(shelfpath)) and not forced:
         raise util.Abort(_('shelve data already exists'))
-            
+
     def shelvefunc(ui, repo, message, match, opts):
         parents = repo.dirstate.parents()
         changes = repo.status(match=match)[:5]
         diffopts = mdiff.diffopts(git=True, nodates=True)
         patch_diff = ''.join(patch.diff(repo, parents[0],
                            match=match, changes=changes, opts=diffopts))
-        
+
         fp = cStringIO.StringIO(patch_diff)
         ac = parsepatch(fp)
         fp.close()
-        
+
         chunks = filterpatch(ui, ac, not opts['all'])
         rc = refilterpatch(ac, chunks)
 
 
         try:
             backups = makebackup(ui, repo, backupdir, newfiles)
-            
+
             # patch to shelve
             sp = cStringIO.StringIO()
             for c in chunks:
                 ui.warn("removing backup failed: %s\n" % err)
                 pass
     fancyopts.fancyopts([], commands.commitopts, opts)
-    
+
     # wrap ui.write so diff output can be labeled/colorized
     def wrapwrite(orig, *args, **kw):
         label = kw.pop('label', '')
     # Check for shelve file at old location first
     if os.path.isfile(repo.join('shelve')):
         ui.status('default\n')
-    
+
     # Now go through all the files in the shelves folder and list them out
     dirname = repo.join('shelves')
     if os.path.isdir(dirname):
         for filename in sorted(os.listdir(repo.join('shelves'))):
             ui.status(filename + '\n')
-    
+
 def unshelve(ui, repo, **opts):
     '''restore shelved changes'''
 
     if opts['list']:
         listshelves(ui,repo)
         return
-        
+
     try:
         patch_diff = repo.opener(shelfpath).read()
         fp = cStringIO.StringIO(patch_diff)
                     else:
                         ui.status('restoring backup files\n')
                         for realname, tmpname in backups.iteritems():
-                            ui.debug('restoring %r to %r\n' % 
+                            ui.debug('restoring %r to %r\n' %
                                      (tmpname, realname))
                             util.copyfile(tmpname, repo.wjoin(realname))
             finally:
     "unshelve":
         (unshelve,
          [('i', 'inspect', None, _('inspect shelved changes only')),
-          ('f', 'force', None, 
+          ('f', 'force', None,
            _('proceed even if patches do not unshelve cleanly')),
            ('n', 'name', '',
             _('unshelve changes from specified shelf name')),