equal
deleted
inserted
replaced
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) |