--- a/mercurial/discovery.py Thu May 12 22:29:05 2016 -0400
+++ b/mercurial/discovery.py Wed May 25 15:32:35 2016 -0500
@@ -240,15 +240,16 @@
def _nowarnheads(pushop):
# Compute newly pushed bookmarks. We don't warn about bookmarked heads.
-
- # internal config: bookmarks.pushing
- newbookmarks = pushop.ui.configlist('bookmarks', 'pushing')
-
repo = pushop.repo.unfiltered()
remote = pushop.remote
localbookmarks = repo._bookmarks
remotebookmarks = remote.listkeys('bookmarks')
bookmarkedheads = set()
+
+ # internal config: bookmarks.pushing
+ newbookmarks = [localbookmarks.expandname(b)
+ for b in pushop.ui.configlist('bookmarks', 'pushing')]
+
for bm in localbookmarks:
rnode = remotebookmarks.get(bm)
if rnode and rnode in repo:
--- a/mercurial/localrepo.py Thu May 12 22:29:05 2016 -0400
+++ b/mercurial/localrepo.py Wed May 25 15:32:35 2016 -0500
@@ -1388,6 +1388,8 @@
node = fctx.filenode()
if node in [fparent1, fparent2]:
self.ui.debug('reusing %s filelog entry\n' % fname)
+ if manifest1.flags(fname) != fctx.flags():
+ changelist.append(fname)
return node
flog = self.file(fname)
--- a/mercurial/repair.py Thu May 12 22:29:05 2016 -0400
+++ b/mercurial/repair.py Wed May 25 15:32:35 2016 -0500
@@ -194,6 +194,7 @@
if not repo.ui.verbose:
repo.ui.popbuffer()
f.close()
+ repo._phasecache.invalidate()
for m in updatebm:
bm[m] = repo[newbmtarget].node()
--- a/tests/test-bookmarks-pushpull.t Thu May 12 22:29:05 2016 -0400
+++ b/tests/test-bookmarks-pushpull.t Wed May 25 15:32:35 2016 -0500
@@ -690,7 +690,7 @@
$ echo c5 > f2
$ hg ci -Am5
created new head
- $ hg push -B W
+ $ hg push -B .
pushing to http://localhost:$HGPORT/
searching for changes
remote: adding changesets
--- a/tests/test-commit-amend.t Thu May 12 22:29:05 2016 -0400
+++ b/tests/test-commit-amend.t Wed May 25 15:32:35 2016 -0500
@@ -1156,3 +1156,21 @@
rev offset length delta linkrev nodeid p1 p2
0 0 88 -1 3 34a4d536c0c0 000000000000 000000000000
+Test if amend preserves executable bit changes
+ $ chmod +x newdirname/commonfile.py
+ $ hg ci -m chmod
+ $ hg ci --amend -m "chmod amended"
+ $ hg ci --amend -m "chmod amended second time"
+ $ hg log -p --git -r .
+ changeset: 8:b1326f52dddf
+ branch: newdirname
+ tag: tip
+ parent: 5:7fd235f7cb2f
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: chmod amended second time
+
+ diff --git a/newdirname/commonfile.py b/newdirname/commonfile.py
+ old mode 100644
+ new mode 100755
+
--- a/tests/test-commit-interactive.t Thu May 12 22:29:05 2016 -0400
+++ b/tests/test-commit-interactive.t Wed May 25 15:32:35 2016 -0500
@@ -895,11 +895,24 @@
$ LANGUAGE=ja
$ export LANGUAGE
- $ hg commit -i --encoding cp932 2>&1 <<EOF | grep '^y - '
+ $ cat > $TESTTMP/escape.py <<EOF
+ > from __future__ import absolute_import
+ > import sys
+ > def escape(c):
+ > o = ord(c)
+ > if o < 0x80:
+ > return c
+ > else:
+ > return r'\x%02x' % o # escape char setting MSB
+ > for l in sys.stdin:
+ > sys.stdout.write(''.join(escape(c) for c in l))
+ > EOF
+
+ $ hg commit -i --encoding cp932 2>&1 <<EOF | python $TESTTMP/escape.py | grep '^y - '
> ?
> q
> EOF
- y - \x82\xb1\x82\xcc\x95\xcf\x8dX\x82\xf0\x8bL\x98^(yes) (esc)
+ y - \x82\xb1\x82\xcc\x95\xcf\x8dX\x82\xf0\x8bL\x98^(yes)
$ LANGUAGE=
#endif
--- a/tests/test-strip.t Thu May 12 22:29:05 2016 -0400
+++ b/tests/test-strip.t Wed May 25 15:32:35 2016 -0500
@@ -838,6 +838,41 @@
date: Thu Jan 01 00:00:00 1970 +0000
summary: mergeCD
+Check that the phase cache is properly invalidated after a strip with bookmark.
+
+ $ cat > ../stripstalephasecache.py << EOF
+ > from mercurial import extensions, localrepo
+ > def transactioncallback(orig, repo, desc, *args, **kwargs):
+ > def test(transaction):
+ > # observe cache inconsistency
+ > try:
+ > [repo.changelog.node(r) for r in repo.revs("not public()")]
+ > except IndexError:
+ > repo.ui.status("Index error!\n")
+ > transaction = orig(repo, desc, *args, **kwargs)
+ > # warm up the phase cache
+ > list(repo.revs("not public()"))
+ > if desc != 'strip':
+ > transaction.addpostclose("phase invalidation test", test)
+ > return transaction
+ > def extsetup(ui):
+ > extensions.wrapfunction(localrepo.localrepository, "transaction",
+ > transactioncallback)
+ > EOF
+ $ hg up -C 2
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ echo k > k
+ $ hg add k
+ $ hg commit -m commitK
+ $ echo l > l
+ $ hg add l
+ $ hg commit -m commitL
+ $ hg book -r tip blah
+ $ hg strip ".^" --config extensions.crash=$TESTTMP/stripstalephasecache.py
+ 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+ saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/8f0b4384875c-4fa10deb-backup.hg (glob)
+ $ hg up -C 1
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
Error during post-close callback of the strip transaction
(They should be gracefully handled and reported)