1831 status = self.status(match=match, clean=force) |
1831 status = self.status(match=match, clean=force) |
1832 if force: |
1832 if force: |
1833 status.modified.extend(status.clean) # mq may commit clean files |
1833 status.modified.extend(status.clean) # mq may commit clean files |
1834 |
1834 |
1835 # check subrepos |
1835 # check subrepos |
1836 subs, commitsubs, newstate = subrepo.precommit( |
1836 subs, commitsubs, newstate = subrepoutil.precommit( |
1837 self.ui, wctx, status, match, force=force) |
1837 self.ui, wctx, status, match, force=force) |
1838 |
1838 |
1839 # make sure all explicit patterns are matched |
1839 # make sure all explicit patterns are matched |
1840 if not force: |
1840 if not force: |
1841 self.checkcommitpatterns(wctx, vdirs, match, status, fail) |
1841 self.checkcommitpatterns(wctx, vdirs, match, status, fail) |
1868 # commit subs and write new state |
1868 # commit subs and write new state |
1869 if subs: |
1869 if subs: |
1870 for s in sorted(commitsubs): |
1870 for s in sorted(commitsubs): |
1871 sub = wctx.sub(s) |
1871 sub = wctx.sub(s) |
1872 self.ui.status(_('committing subrepository %s\n') % |
1872 self.ui.status(_('committing subrepository %s\n') % |
1873 subrepo.subrelpath(sub)) |
1873 subrepoutil.subrelpath(sub)) |
1874 sr = sub.commit(cctx._text, user, date) |
1874 sr = sub.commit(cctx._text, user, date) |
1875 newstate[s] = (newstate[s][0], sr) |
1875 newstate[s] = (newstate[s][0], sr) |
1876 subrepo.writestate(self, newstate) |
1876 subrepoutil.writestate(self, newstate) |
1877 |
1877 |
1878 p1, p2 = self.dirstate.parents() |
1878 p1, p2 = self.dirstate.parents() |
1879 hookp1, hookp2 = hex(p1), (p2 != nullid and hex(p2) or '') |
1879 hookp1, hookp2 = hex(p1), (p2 != nullid and hex(p2) or '') |
1880 try: |
1880 try: |
1881 self.hook("precommit", throw=True, parent1=hookp1, |
1881 self.hook("precommit", throw=True, parent1=hookp1, |
1981 user, ctx.date(), ctx.extra().copy()) |
1981 user, ctx.date(), ctx.extra().copy()) |
1982 xp1, xp2 = p1.hex(), p2 and p2.hex() or '' |
1982 xp1, xp2 = p1.hex(), p2 and p2.hex() or '' |
1983 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1, |
1983 self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1, |
1984 parent2=xp2) |
1984 parent2=xp2) |
1985 # set the new commit is proper phase |
1985 # set the new commit is proper phase |
1986 targetphase = subrepo.newcommitphase(self.ui, ctx) |
1986 targetphase = subrepoutil.newcommitphase(self.ui, ctx) |
1987 if targetphase: |
1987 if targetphase: |
1988 # retract boundary do not alter parent changeset. |
1988 # retract boundary do not alter parent changeset. |
1989 # if a parent have higher the resulting phase will |
1989 # if a parent have higher the resulting phase will |
1990 # be compliant anyway |
1990 # be compliant anyway |
1991 # |
1991 # |