Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 18073:e411fd79ca69
obsolete: refuse to push divergent changeset
As other troubles `unstable` and `bumped`. Followup patches may simplify the
push code with unification of "obsolescence troubles" handling.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Sat, 10 Nov 2012 02:19:20 +0100 |
parents | b35e3364f94a |
children | 739c88ff043c |
comparison
equal
deleted
inserted
replaced
18072:03604f46d48a | 18073:e411fd79ca69 |
---|---|
1916 if unfi.obsstore: | 1916 if unfi.obsstore: |
1917 # this message are here for 80 char limit reason | 1917 # this message are here for 80 char limit reason |
1918 mso = _("push includes obsolete changeset: %s!") | 1918 mso = _("push includes obsolete changeset: %s!") |
1919 msu = _("push includes unstable changeset: %s!") | 1919 msu = _("push includes unstable changeset: %s!") |
1920 msb = _("push includes bumped changeset: %s!") | 1920 msb = _("push includes bumped changeset: %s!") |
1921 msd = _("push includes divergent changeset: %s!") | |
1921 # If we are to push if there is at least one | 1922 # If we are to push if there is at least one |
1922 # obsolete or unstable changeset in missing, at | 1923 # obsolete or unstable changeset in missing, at |
1923 # least one of the missinghead will be obsolete or | 1924 # least one of the missinghead will be obsolete or |
1924 # unstable. So checking heads only is ok | 1925 # unstable. So checking heads only is ok |
1925 for node in outgoing.missingheads: | 1926 for node in outgoing.missingheads: |
1928 raise util.Abort(mso % ctx) | 1929 raise util.Abort(mso % ctx) |
1929 elif ctx.unstable(): | 1930 elif ctx.unstable(): |
1930 raise util.Abort(msu % ctx) | 1931 raise util.Abort(msu % ctx) |
1931 elif ctx.bumped(): | 1932 elif ctx.bumped(): |
1932 raise util.Abort(msb % ctx) | 1933 raise util.Abort(msb % ctx) |
1934 elif ctx.divergent(): | |
1935 raise util.Abort(msd % ctx) | |
1933 discovery.checkheads(unfi, remote, outgoing, | 1936 discovery.checkheads(unfi, remote, outgoing, |
1934 remoteheads, newbranch, | 1937 remoteheads, newbranch, |
1935 bool(inc)) | 1938 bool(inc)) |
1936 | 1939 |
1937 # create a changegroup from local | 1940 # create a changegroup from local |