--- a/hgext/largefiles/overrides.py Wed Jan 02 00:02:22 2013 -0600
+++ b/hgext/largefiles/overrides.py Wed Jan 02 00:03:31 2013 -0600
@@ -565,6 +565,7 @@
lfdirstate = lfutil.openlfdirstate(ui, repo)
(modified, added, removed, missing, unknown, ignored, clean) = \
lfutil.lfdirstatestatus(lfdirstate, repo, repo['.'].rev())
+ lfdirstate.write()
for lfile in modified:
lfutil.updatestandin(repo, lfutil.standin(lfile))
for lfile in missing:
--- a/hgext/largefiles/reposetup.py Wed Jan 02 00:02:22 2013 -0600
+++ b/hgext/largefiles/reposetup.py Wed Jan 02 00:03:31 2013 -0600
@@ -164,10 +164,8 @@
m = copy.copy(match)
m._files = tostandins(m._files)
- # Get ignored files here even if we weren't asked for them; we
- # must use the result here for filtering later
result = super(lfilesrepo, self).status(node1, node2, m,
- True, clean, unknown, listsubrepos)
+ ignored, clean, unknown, listsubrepos)
if working:
try:
# Any non-largefiles that were explicitly listed must be
@@ -269,6 +267,8 @@
return f
result = [[toname(f) for f in items] for items in result]
+ lfdirstate.write()
+
if not listunknown:
result[4] = []
if not listignored:
--- a/hgext/zeroconf/__init__.py Wed Jan 02 00:02:22 2013 -0600
+++ b/hgext/zeroconf/__init__.py Wed Jan 02 00:03:31 2013 -0600
@@ -27,10 +27,9 @@
import socket, time, os
import Zeroconf
-from mercurial import ui, hg, encoding, util, dispatch
+from mercurial import ui, hg, encoding, dispatch
from mercurial import extensions
-from mercurial.hgweb import hgweb_mod
-from mercurial.hgweb import hgwebdir_mod
+from mercurial.hgweb import server as servermod
testedwith = 'internal'
@@ -102,27 +101,29 @@
address = localip, weight = 0, priority = 0)
server.registerService(svc)
-class hgwebzc(hgweb_mod.hgweb):
- def __init__(self, repo, name=None, baseui=None):
- super(hgwebzc, self).__init__(repo, name=name, baseui=baseui)
- name = self.reponame or os.path.basename(self.repo.root)
- path = self.repo.ui.config("web", "prefix", "").strip('/')
- desc = self.repo.ui.config("web", "description", name)
- publish(name, desc, path,
- util.getport(self.repo.ui.config("web", "port", 8000)))
+def zc_create_server(create_server, ui, app):
+ httpd = create_server(ui, app)
+ port = httpd.port
-class hgwebdirzc(hgwebdir_mod.hgwebdir):
- def __init__(self, conf, baseui=None):
- super(hgwebdirzc, self).__init__(conf, baseui=baseui)
- prefix = self.ui.config("web", "prefix", "").strip('/') + '/'
- for repo, path in self.repos:
- u = self.ui.copy()
+ try:
+ repos = app.repos
+ except AttributeError:
+ # single repo
+ name = app.reponame or os.path.basename(app.repo.root)
+ path = app.repo.ui.config("web", "prefix", "").strip('/')
+ desc = app.repo.ui.config("web", "description", name)
+ publish(name, desc, path, port)
+ else:
+ # webdir
+ prefix = app.ui.config("web", "prefix", "").strip('/') + '/'
+ for repo, path in repos:
+ u = app.ui.copy()
u.readconfig(os.path.join(path, '.hg', 'hgrc'))
name = os.path.basename(repo)
path = (prefix + repo).strip('/')
desc = u.config('web', 'description', name)
- publish(name, desc, path,
- util.getport(u.config("web", "port", 8000)))
+ publish(name, desc, path, port)
+ return httpd
# listen
@@ -184,5 +185,4 @@
extensions.wrapfunction(ui.ui, 'config', config)
extensions.wrapfunction(ui.ui, 'configitems', configitems)
extensions.wrapfunction(hg, 'defaultdest', defaultdest)
-hgweb_mod.hgweb = hgwebzc
-hgwebdir_mod.hgwebdir = hgwebdirzc
+extensions.wrapfunction(servermod, 'create_server', zc_create_server)
--- a/mercurial/bundlerepo.py Wed Jan 02 00:02:22 2013 -0600
+++ b/mercurial/bundlerepo.py Wed Jan 02 00:03:31 2013 -0600
@@ -347,7 +347,7 @@
os.unlink(bundlename)
except OSError:
pass
- return other, [], other.close
+ return repo, [], other.close
bundle = None
bundlerepo = None
--- a/mercurial/cmdutil.py Wed Jan 02 00:02:22 2013 -0600
+++ b/mercurial/cmdutil.py Wed Jan 02 00:03:31 2013 -0600
@@ -1619,7 +1619,7 @@
ui.note(_('amending changeset %s\n') % old)
base = old.p1()
- wlock = lock = None
+ wlock = lock = newid = None
try:
wlock = repo.wlock()
lock = repo.lock()
@@ -1635,10 +1635,13 @@
# First, do a regular commit to record all changes in the working
# directory (if there are any)
ui.callhooks = False
+ currentbookmark = repo._bookmarkcurrent
try:
+ repo._bookmarkcurrent = None
opts['message'] = 'temporary amend commit for %s' % old
node = commit(ui, repo, commitfunc, pats, opts)
finally:
+ repo._bookmarkcurrent = currentbookmark
ui.callhooks = True
ctx = repo[node]
@@ -1782,6 +1785,8 @@
ui.note(_('stripping amended changeset %s\n') % old)
repair.strip(ui, repo, old.node(), topic='amend-backup')
finally:
+ if newid is None:
+ repo.dirstate.invalidate()
lockmod.release(wlock, lock)
return newid
--- a/mercurial/commands.py Wed Jan 02 00:02:22 2013 -0600
+++ b/mercurial/commands.py Wed Jan 02 00:03:31 2013 -0600
@@ -4288,7 +4288,7 @@
if not node and repo._bookmarkcurrent:
bmheads = repo.bookmarkheads(repo._bookmarkcurrent)
- curhead = repo[repo._bookmarkcurrent]
+ curhead = repo[repo._bookmarkcurrent].node()
if len(bmheads) == 2:
if curhead == bmheads[0]:
node = bmheads[1]
--- a/mercurial/hgweb/hgwebdir_mod.py Wed Jan 02 00:02:22 2013 -0600
+++ b/mercurial/hgweb/hgwebdir_mod.py Wed Jan 02 00:03:31 2013 -0600
@@ -184,7 +184,13 @@
fname = virtual[7:]
else:
fname = req.form['static'][0]
- static = templater.templatepath('static')
+ static = self.ui.config("web", "static", None,
+ untrusted=False)
+ if not static:
+ tp = self.templatepath or templater.templatepath()
+ if isinstance(tp, str):
+ tp = [tp]
+ static = [os.path.join(p, 'static') for p in tp]
return (staticfile(static, fname, req),)
# top-level index
--- a/mercurial/scmutil.py Wed Jan 02 00:02:22 2013 -0600
+++ b/mercurial/scmutil.py Wed Jan 02 00:03:31 2013 -0600
@@ -262,8 +262,12 @@
def _cansymlink(self):
return util.checklink(self.base)
+ @util.propertycache
+ def _chmod(self):
+ return util.checkexec(self.base)
+
def _fixfilemode(self, name):
- if self.createmode is None:
+ if self.createmode is None or not self._chmod:
return
os.chmod(name, self.createmode & 0666)
--- a/mercurial/templates/paper/help.tmpl Wed Jan 02 00:02:22 2013 -0600
+++ b/mercurial/templates/paper/help.tmpl Wed Jan 02 00:03:31 2013 -0600
@@ -1,9 +1,5 @@
{header}
<title>Help: {topic}</title>
-<link rel="alternate" type="application/atom+xml"
- href="{url}atom-tags" title="Atom feed for {repo|escape}" />
-<link rel="alternate" type="application/rss+xml"
- href="{url}rss-tags" title="RSS feed for {repo|escape}" />
</head>
<body>
--- a/mercurial/templates/paper/helptopics.tmpl Wed Jan 02 00:02:22 2013 -0600
+++ b/mercurial/templates/paper/helptopics.tmpl Wed Jan 02 00:03:31 2013 -0600
@@ -1,9 +1,5 @@
{header}
<title>Help: {title}</title>
-<link rel="alternate" type="application/atom+xml"
- href="{url}atom-tags" title="Atom feed for {repo|escape}" />
-<link rel="alternate" type="application/rss+xml"
- href="{url}rss-tags" title="RSS feed for {repo|escape}" />
</head>
<body>
--- a/tests/test-bookmarks-merge.t Wed Jan 02 00:02:22 2013 -0600
+++ b/tests/test-bookmarks-merge.t Wed Jan 02 00:03:31 2013 -0600
@@ -75,9 +75,27 @@
$ echo f > f
$ hg commit -Am "f"
adding f
+ $ hg bookmarks -r 4 "e@diverged"
+ $ hg up -q -C "e@diverged"
+ $ hg merge
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+ $ hg parents
+ changeset: 4:a0546fcfe0fb
+ bookmark: e@diverged
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: d
+
+ changeset: 5:26bee9c5bcf3
+ bookmark: e
+ parent: 3:b8f96cf4688b
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: e
+
$ hg up -C e
- 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
- $ hg bookmarks -r 4 "e@diverged"
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg bookmarks
b 1:d2ae7f538514
c 3:b8f96cf4688b
--- a/tests/test-command-template.t Wed Jan 02 00:02:22 2013 -0600
+++ b/tests/test-command-template.t Wed Jan 02 00:03:31 2013 -0600
@@ -1348,7 +1348,8 @@
>>> from datetime import datetime
>>> fp = open('a', 'w')
- >>> fp.write(str(datetime.now().year + 8) + '-01-01 00:00')
+ >>> n = datetime.now()
+ >>> fp.write('%d-%d-%d 00:00' % ((n.year + 7), n.month, n.day))
>>> fp.close()
$ hg add a
$ hg commit -m future -d "`cat a`"
--- a/tests/test-commit-amend.t Wed Jan 02 00:02:22 2013 -0600
+++ b/tests/test-commit-amend.t Wed Jan 02 00:03:31 2013 -0600
@@ -58,11 +58,34 @@
summary: base
-Add new file:
+Check proper abort for empty message
+ $ cat > editor.sh << '__EOF__'
+ > #!/bin/sh
+ > echo "" > "$1"
+ > __EOF__
$ echo b > b
- $ hg ci --amend -Am 'amend base1 new file'
- adding b
+ $ hg add b
+ $ hg summary
+ parent: 1:43f1ba15f28a tip
+ amend base1
+ branch: default
+ commit: 1 added, 1 unknown
+ update: (current)
+ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
+ transaction abort!
+ rollback completed
+ abort: empty commit message
+ [255]
+ $ hg summary
+ parent: 1:43f1ba15f28a tip
+ amend base1
+ branch: default
+ commit: 1 added, 1 unknown
+ update: (current)
+
+Add new file:
+ $ hg ci --amend -m 'amend base1 new file'
saved backup bundle to $TESTTMP/.hg/strip-backup/43f1ba15f28a-amend-backup.hg (glob)
Remove file that was added in amended commit:
@@ -220,6 +243,24 @@
book1 1:48bb6e53a15f
* book2 1:48bb6e53a15f
+abort does not loose bookmarks
+
+ $ cat > editor.sh << '__EOF__'
+ > #!/bin/sh
+ > echo "" > "$1"
+ > __EOF__
+ $ echo a >> a
+ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
+ transaction abort!
+ rollback completed
+ abort: empty commit message
+ [255]
+ $ hg book
+ book1 1:48bb6e53a15f
+ * book2 1:48bb6e53a15f
+ $ hg revert -Caq
+ $ rm editor.sh
+
$ echo '[defaults]' >> $HGRCPATH
$ echo "commit=-d '0 0'" >> $HGRCPATH
--- a/tests/test-diff-color.t Wed Jan 02 00:02:22 2013 -0600
+++ b/tests/test-diff-color.t Wed Jan 02 00:03:31 2013 -0600
@@ -152,7 +152,7 @@
c
c
\x1b[0;32m+aa\x1b[0m (esc)
- \x1b[0;1mdiff --git a/sub/b b/sub/b\x1b[0m (esc)
+ \x1b[0;1mdiff --git a/sub/b b/sub/b\x1b[0m (glob) (esc)
\x1b[0;31;1m--- a/sub/b\x1b[0m (esc)
\x1b[0;32;1m+++ b/sub/b\x1b[0m (esc)
\x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
--- a/tests/test-rebase-pull.t Wed Jan 02 00:02:22 2013 -0600
+++ b/tests/test-rebase-pull.t Wed Jan 02 00:03:31 2013 -0600
@@ -144,7 +144,7 @@
adding L1
created new head
$ hg pull --rev tip --rebase
- pulling from $TESTTMP/a
+ pulling from $TESTTMP/a (glob)
searching for changes
adding changesets
adding manifests
--- a/tests/test-transplant.t Wed Jan 02 00:02:22 2013 -0600
+++ b/tests/test-transplant.t Wed Jan 02 00:03:31 2013 -0600
@@ -288,6 +288,15 @@
1 b1
0 r1
+remote transplant without pull
+
+ $ hg pull -q http://localhost:$HGPORT/
+ $ hg transplant -s http://localhost:$HGPORT/ 2 4
+ searching for changes
+ skipping already applied revision 2:8d9279348abb
+ applying 722f4667af76
+ 722f4667af76 transplanted to 76e321915884
+
transplant --continue
$ hg init ../tc