Mercurial > hg
changeset 16049:e9c93d60a2b5 stable
merge with i18n
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 01 Feb 2012 13:50:45 -0600 |
parents | 140b6282ac79 (diff) cdc547297c23 (current diff) |
children | aaaa7ebc578b |
files | |
diffstat | 4 files changed, 51 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/mq.py Tue Jan 31 18:11:08 2012 -0200 +++ b/hgext/mq.py Wed Feb 01 13:50:45 2012 -0600 @@ -745,8 +745,11 @@ repo.dirstate.setparents(p1, merge) match = scmutil.matchfiles(repo, files or []) + oldtip = repo['tip'] n = secretcommit(repo, message, ph.user, ph.date, match=match, force=True) + if repo['tip'] == oldtip: + raise util.Abort(_("qpush exactly duplicates child changeset")) if n is None: raise util.Abort(_("repository commit failed")) @@ -1310,6 +1313,10 @@ if heads != [self.applied[-1].node]: raise util.Abort(_("popping would remove a revision not " "managed by this patch queue")) + if not repo[self.applied[-1].node].mutable(): + raise util.Abort( + _("popping would remove an immutable revision"), + hint=_('see "hg help phases" for details')) # we know there are no local changes, so we can make a simplified # form of hg.update. @@ -1371,6 +1378,9 @@ (top, patchfn) = (self.applied[-1].node, self.applied[-1].name) if repo.changelog.heads(top) != [top]: raise util.Abort(_("cannot refresh a revision with children")) + if not repo[top].mutable(): + raise util.Abort(_("cannot refresh immutable revision"), + hint=_('see "hg help phases" for details')) inclsubs = self.checksubstate(repo)
--- a/mercurial/bundlerepo.py Tue Jan 31 18:11:08 2012 -0200 +++ b/mercurial/bundlerepo.py Wed Feb 01 13:50:45 2012 -0600 @@ -14,7 +14,7 @@ from node import nullid from i18n import _ import os, tempfile, shutil -import changegroup, util, mdiff, discovery +import changegroup, util, mdiff, discovery, cmdutil import localrepo, changelog, manifest, filelog, revlog, error class bundlerevlog(revlog.revlog): @@ -274,6 +274,11 @@ if create: raise util.Abort(_('cannot create new bundle repository')) parentpath = ui.config("bundle", "mainreporoot", "") + if not parentpath: + # try to find the correct path to the working directory repo + parentpath = cmdutil.findrepo(os.getcwd()) + if parentpath is None: + parentpath = '' if parentpath: # Try to make the full path relative so we get a nice, short URL. # In particular, we don't want temp dir names in test outputs.
--- a/mercurial/help/phases.txt Tue Jan 31 18:11:08 2012 -0200 +++ b/mercurial/help/phases.txt Wed Feb 01 13:50:45 2012 -0600 @@ -77,4 +77,8 @@ hg log --template "{rev} {phase}\n" + - resynchronize draft changesets relative to a remote repository:: + + hg phase -fd 'outgoing(URL)' + See :hg:`help phase` for more information on manually manipulating phases.
--- a/tests/test-mq-safety.t Tue Jan 31 18:11:08 2012 -0200 +++ b/tests/test-mq-safety.t Wed Feb 01 13:50:45 2012 -0600 @@ -1,5 +1,6 @@ $ echo '[extensions]' >> $HGRCPATH - $ echo 'mq =' >> $HGRCPATH + $ echo 'hgext.mq =' >> $HGRCPATH + $ echo 'hgext.graphlog =' >> $HGRCPATH $ hg init repo $ cd repo @@ -17,6 +18,35 @@ $ echo bar >> foo $ hg qrefresh -m 'append bar' +Try to operate on public mq changeset + + $ hg qpop + popping bar + now at: foo + $ hg phase --public qbase + $ echo babar >> foo + $ hg qref + abort: cannot refresh immutable revision + (see "hg help phases" for details) + [255] + $ hg revert -a + reverting foo + $ hg qpop + abort: popping would remove an immutable revision + (see "hg help phases" for details) + [255] + $ hg qfold bar + abort: cannot refresh immutable revision + (see "hg help phases" for details) + [255] + $ hg revert -a + reverting foo + +restore state for remaining test + + $ hg qpush + applying bar + now at: bar try to commit on top of a patch