merge with stable

This commit is contained in:
Matt Mackall 2013-01-02 00:24:28 -06:00
commit fe2cbf4904
8 changed files with 463 additions and 139 deletions

View File

@ -62,3 +62,4 @@ b3f0f9a39c4e1d0250048cd803ab03542d6f140a 0 iD8DBQBQamltywK+sNU5EO8RAlsqAJ4qF/m6a
d118a4f4fd16d9b558ec3f3e87bfee772861d2b7 0 iD8DBQBQgPV5ywK+sNU5EO8RArylAJ0abcx5NlDjyv3ZDWpAfRIHyRsJtQCgn4TMuEayqgxzrvadQZHdTEU2g38=
195ad823b5d58c68903a6153a25e3fb4ed25239d 0 iD8DBQBQkuT9ywK+sNU5EO8RAhB4AKCeerItoK2Jipm2cVf4euGofAa/WACeJj3TVd4pFILpb+ogj7ebweFLJi0=
0c10cf8191469e7c3c8844922e17e71a176cb7cb 0 iD8DBQBQvQWoywK+sNU5EO8RAnq3AJoCn98u4geFx5YaQaeh99gFhCd7bQCgjoBwBSUyOvGd0yBy60E3Vv3VZhM=
a4765077b65e6ae29ba42bab7834717b5072d5ba 0 iD8DBQBQ486sywK+sNU5EO8RAhmJAJ90aLfLKZhmcZN7kqphigQJxiFOQACeJ5IUZxjGKH4xzi3MrgIcx9n+dB0=

File diff suppressed because it is too large Load Diff

View File

@ -1617,7 +1617,7 @@ def amend(ui, repo, commitfunc, old, extra, pats, opts):
ui.note(_('amending changeset %s\n') % old)
base = old.p1()
wlock = lock = None
wlock = lock = newid = None
try:
wlock = repo.wlock()
lock = repo.lock()
@ -1633,10 +1633,13 @@ def amend(ui, repo, commitfunc, old, extra, pats, opts):
# 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]
@ -1781,6 +1784,8 @@ def amend(ui, repo, commitfunc, old, extra, pats, opts):
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

View File

@ -184,7 +184,13 @@ class hgwebdir(object):
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

View File

@ -262,8 +262,12 @@ class vfs(abstractvfs):
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)

View File

@ -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>

View File

@ -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>

View File

@ -58,11 +58,34 @@ Amending changeset with changes in working dir:
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 @@ Moving bookmarks, preserve active bookmark:
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