comparison mercurial/cmdutil.py @ 41759:aaad36b88298

cleanup: use () to wrap long lines instead of \ This is a little less brittle, and often helps indentation. In a surprising number of cases the entire cleanup was deleting the \, as the expression was *already* parenthesized in a workable way. Differential Revision: https://phab.mercurial-scm.org/D5993
author Augie Fackler <augie@google.com>
date Wed, 20 Feb 2019 19:28:51 -0500
parents 980e05204ed8
children dcbb1b4dc93a
comparison
equal deleted inserted replaced
41758:15d3facfa40a 41759:aaad36b88298
177 return isinstance(x, hunkclasses) 177 return isinstance(x, hunkclasses)
178 178
179 def newandmodified(chunks, originalchunks): 179 def newandmodified(chunks, originalchunks):
180 newlyaddedandmodifiedfiles = set() 180 newlyaddedandmodifiedfiles = set()
181 for chunk in chunks: 181 for chunk in chunks:
182 if ishunk(chunk) and chunk.header.isnewfile() and chunk not in \ 182 if (ishunk(chunk) and chunk.header.isnewfile() and chunk not in
183 originalchunks: 183 originalchunks):
184 newlyaddedandmodifiedfiles.add(chunk.header.filename()) 184 newlyaddedandmodifiedfiles.add(chunk.header.filename())
185 return newlyaddedandmodifiedfiles 185 return newlyaddedandmodifiedfiles
186 186
187 def parsealiases(cmd): 187 def parsealiases(cmd):
188 return cmd.split("|") 188 return cmd.split("|")
320 # 2. backup changed files, so we can restore them in the end 320 # 2. backup changed files, so we can restore them in the end
321 321
322 if backupall: 322 if backupall:
323 tobackup = changed 323 tobackup = changed
324 else: 324 else:
325 tobackup = [f for f in newfiles if f in modified or f in \ 325 tobackup = [f for f in newfiles if f in modified or f in
326 newlyaddedandmodifiedfiles] 326 newlyaddedandmodifiedfiles]
327 backups = {} 327 backups = {}
328 if tobackup: 328 if tobackup:
329 backupdir = repo.vfs.join('record-backups') 329 backupdir = repo.vfs.join('record-backups')
330 try: 330 try:
331 os.mkdir(backupdir) 331 os.mkdir(backupdir)