2453 # the assumption that the user will use the same editor again. |
2453 # the assumption that the user will use the same editor again. |
2454 msgfn = self.savecommitmessage(cctx._text) |
2454 msgfn = self.savecommitmessage(cctx._text) |
2455 |
2455 |
2456 # commit subs and write new state |
2456 # commit subs and write new state |
2457 if subs: |
2457 if subs: |
|
2458 uipathfn = scmutil.getuipathfn(self) |
2458 for s in sorted(commitsubs): |
2459 for s in sorted(commitsubs): |
2459 sub = wctx.sub(s) |
2460 sub = wctx.sub(s) |
2460 self.ui.status(_('committing subrepository %s\n') % |
2461 self.ui.status(_('committing subrepository %s\n') % |
2461 subrepoutil.subrelpath(sub)) |
2462 uipathfn(subrepoutil.subrelpath(sub))) |
2462 sr = sub.commit(cctx._text, user, date) |
2463 sr = sub.commit(cctx._text, user, date) |
2463 newstate[s] = (newstate[s][0], sr) |
2464 newstate[s] = (newstate[s][0], sr) |
2464 subrepoutil.writestate(self, newstate) |
2465 subrepoutil.writestate(self, newstate) |
2465 |
2466 |
2466 p1, p2 = self.dirstate.parents() |
2467 p1, p2 = self.dirstate.parents() |
2524 added = [] |
2525 added = [] |
2525 changed = [] |
2526 changed = [] |
2526 removed = list(ctx.removed()) |
2527 removed = list(ctx.removed()) |
2527 linkrev = len(self) |
2528 linkrev = len(self) |
2528 self.ui.note(_("committing files:\n")) |
2529 self.ui.note(_("committing files:\n")) |
|
2530 uipathfn = scmutil.getuipathfn(self) |
2529 for f in sorted(ctx.modified() + ctx.added()): |
2531 for f in sorted(ctx.modified() + ctx.added()): |
2530 self.ui.note(f + "\n") |
2532 self.ui.note(uipathfn(f) + "\n") |
2531 try: |
2533 try: |
2532 fctx = ctx[f] |
2534 fctx = ctx[f] |
2533 if fctx is None: |
2535 if fctx is None: |
2534 removed.append(f) |
2536 removed.append(f) |
2535 else: |
2537 else: |
2536 added.append(f) |
2538 added.append(f) |
2537 m[f] = self._filecommit(fctx, m1, m2, linkrev, |
2539 m[f] = self._filecommit(fctx, m1, m2, linkrev, |
2538 trp, changed) |
2540 trp, changed) |
2539 m.setflag(f, fctx.flags()) |
2541 m.setflag(f, fctx.flags()) |
2540 except OSError: |
2542 except OSError: |
2541 self.ui.warn(_("trouble committing %s!\n") % f) |
2543 self.ui.warn(_("trouble committing %s!\n") % |
|
2544 uipathfn(f)) |
2542 raise |
2545 raise |
2543 except IOError as inst: |
2546 except IOError as inst: |
2544 errcode = getattr(inst, 'errno', errno.ENOENT) |
2547 errcode = getattr(inst, 'errno', errno.ENOENT) |
2545 if error or errcode and errcode != errno.ENOENT: |
2548 if error or errcode and errcode != errno.ENOENT: |
2546 self.ui.warn(_("trouble committing %s!\n") % f) |
2549 self.ui.warn(_("trouble committing %s!\n") % |
|
2550 uipathfn(f)) |
2547 raise |
2551 raise |
2548 |
2552 |
2549 # update manifest |
2553 # update manifest |
2550 removed = [f for f in sorted(removed) if f in m1 or f in m2] |
2554 removed = [f for f in sorted(removed) if f in m1 or f in m2] |
2551 drop = [f for f in removed if f in m] |
2555 drop = [f for f in removed if f in m] |