Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 18162:df1b37c8ae67
obsolete: factorise troubles detection during push
The use of the two methods introduced earlier allows a factorisation of the
push code preventing push of troubled changeset.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Fri, 21 Dec 2012 22:58:59 +0100 |
parents | d8e7b3a14957 |
children | d336f53cb2e3 |
comparison
equal
deleted
inserted
replaced
18161:5b117f82cbdb | 18162:df1b37c8ae67 |
---|---|
1814 # if self.obsstore == False --> no obsolete | 1814 # if self.obsstore == False --> no obsolete |
1815 # then, save the iteration | 1815 # then, save the iteration |
1816 if unfi.obsstore: | 1816 if unfi.obsstore: |
1817 # this message are here for 80 char limit reason | 1817 # this message are here for 80 char limit reason |
1818 mso = _("push includes obsolete changeset: %s!") | 1818 mso = _("push includes obsolete changeset: %s!") |
1819 msu = _("push includes unstable changeset: %s!") | 1819 mst = "push includes %s changeset: %s!" |
1820 msb = _("push includes bumped changeset: %s!") | 1820 # plain versions for i18n tool to detect them |
1821 msd = _("push includes divergent changeset: %s!") | 1821 _("push includes unstable changeset: %s!") |
1822 _("push includes bumped changeset: %s!") | |
1823 _("push includes divergent changeset: %s!") | |
1822 # If we are to push if there is at least one | 1824 # If we are to push if there is at least one |
1823 # obsolete or unstable changeset in missing, at | 1825 # obsolete or unstable changeset in missing, at |
1824 # least one of the missinghead will be obsolete or | 1826 # least one of the missinghead will be obsolete or |
1825 # unstable. So checking heads only is ok | 1827 # unstable. So checking heads only is ok |
1826 for node in outgoing.missingheads: | 1828 for node in outgoing.missingheads: |
1827 ctx = unfi[node] | 1829 ctx = unfi[node] |
1828 if ctx.obsolete(): | 1830 if ctx.obsolete(): |
1829 raise util.Abort(mso % ctx) | 1831 raise util.Abort(mso % ctx) |
1830 elif ctx.unstable(): | 1832 elif ctx.troubled(): |
1831 raise util.Abort(msu % ctx) | 1833 raise util.Abort(_(mst) |
1832 elif ctx.bumped(): | 1834 % (ctx.troubles()[0], |
1833 raise util.Abort(msb % ctx) | 1835 ctx)) |
1834 elif ctx.divergent(): | |
1835 raise util.Abort(msd % ctx) | |
1836 discovery.checkheads(unfi, remote, outgoing, | 1836 discovery.checkheads(unfi, remote, outgoing, |
1837 remoteheads, newbranch, | 1837 remoteheads, newbranch, |
1838 bool(inc)) | 1838 bool(inc)) |
1839 | 1839 |
1840 # create a changegroup from local | 1840 # create a changegroup from local |