# HG changeset patch # User Martin Geisler # Date 1300017916 -3600 # Node ID 2151703e7f844fb42864d49c853ea7cb284bbb9b # Parent 3f6a4579f803a41f637a9cf3992e0de5bd1205ec# Parent 1532ed1e50ca5d1a60fa09c31b9a6b5d1fbed82f merge with stable diff -r 3f6a4579f803 -r 2151703e7f84 hgext/transplant.py --- a/hgext/transplant.py Sun Mar 13 12:24:17 2011 +0100 +++ b/hgext/transplant.py Sun Mar 13 13:05:16 2011 +0100 @@ -453,8 +453,13 @@ '''transplant changesets from another branch Selected changesets will be applied on top of the current working - directory with the log of the original changeset. If --log is - specified, log messages will have a comment appended of the form:: + directory with the log of the original changeset. The changesets + are copied and will thus appear twice in the history. Use the + rebase extension instead if you want to move a whole branch of + unpublished changesets. + + If --log is specified, log messages will have a comment appended + of the form:: (transplanted from CHANGESETHASH) @@ -469,9 +474,9 @@ transplanted, otherwise you will be prompted to select the changesets you want. - :hg:`transplant --branch REVISION --all` will rebase the selected - branch (up to the named revision) onto your current working - directory. + :hg:`transplant --branch REVISION --all` will transplant the + selected branch (up to the named revision) onto your current + working directory. You can optionally mark selected transplanted changesets as merge changesets. You will not be prompted to transplant any ancestors diff -r 3f6a4579f803 -r 2151703e7f84 mercurial/hgweb/request.py --- a/mercurial/hgweb/request.py Sun Mar 13 12:24:17 2011 +0100 +++ b/mercurial/hgweb/request.py Sun Mar 13 13:05:16 2011 +0100 @@ -66,7 +66,7 @@ def drain(self): '''need to read all data from request, httplib is half-duplex''' - length = int(self.env.get('CONTENT_LENGTH', 0)) + length = int(self.env.get('CONTENT_LENGTH') or 0) for s in util.filechunkiter(self.inp, limit=length): pass diff -r 3f6a4579f803 -r 2151703e7f84 mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Sun Mar 13 12:24:17 2011 +0100 +++ b/mercurial/hgweb/webcommands.py Sun Mar 13 13:05:16 2011 +0100 @@ -21,8 +21,8 @@ __all__ = [ 'log', 'rawfile', 'file', 'changelog', 'shortlog', 'changeset', 'rev', - 'manifest', 'tags', 'branches', 'summary', 'filediff', 'diff', 'annotate', - 'filelog', 'archive', 'static', 'graph', 'help', + 'manifest', 'tags', 'bookmarks', 'branches', 'summary', 'filediff', 'diff', + 'annotate', 'filelog', 'archive', 'static', 'graph', 'help', ] def log(web, req, tmpl): @@ -205,6 +205,7 @@ "rev": i, "node": hex(n), "tags": webutil.nodetagsdict(web.repo, n), + "bookmarks": webutil.nodebookmarksdict(web.repo, n), "inbranch": webutil.nodeinbranch(web.repo, ctx), "branches": webutil.nodebranchdict(web.repo, ctx) }) @@ -247,6 +248,8 @@ def changeset(web, req, tmpl): ctx = webutil.changectx(web.repo, req) showtags = webutil.showtag(web.repo, tmpl, 'changesettag', ctx.node()) + showbookmarks = webutil.showbookmark(web.repo, tmpl, 'changesetbookmark', + ctx.node()) showbranch = webutil.nodebranchnodefault(ctx) files = [] @@ -270,6 +273,7 @@ parent=webutil.parents(ctx), child=webutil.children(ctx), changesettag=showtags, + changesetbookmark=showbookmarks, changesetbranch=showbranch, author=ctx.user(), desc=ctx.description(), @@ -277,6 +281,7 @@ files=files, archives=web.archivelist(ctx.hex()), tags=webutil.nodetagsdict(web.repo, ctx.node()), + bookmarks=webutil.nodebookmarksdict(web.repo, ctx.node()), branch=webutil.nodebranchnodefault(ctx), inbranch=webutil.nodeinbranch(web.repo, ctx), branches=webutil.nodebranchdict(web.repo, ctx)) @@ -384,6 +389,30 @@ entriesnotip=lambda **x: entries(True, 0, **x), latestentry=lambda **x: entries(True, 1, **x)) +def bookmarks(web, req, tmpl): + i = web.repo._bookmarks.items() + i.reverse() + parity = paritygen(web.stripecount) + + def entries(notip=False, limit=0, **map): + count = 0 + for k, n in i: + if notip and k == "tip": + continue + if limit > 0 and count >= limit: + continue + count = count + 1 + yield {"parity": parity.next(), + "bookmark": k, + "date": web.repo[n].date(), + "node": hex(n)} + + return tmpl("bookmarks", + node=hex(web.repo.changelog.tip()), + entries=lambda **x: entries(False, 0, **x), + entriesnotip=lambda **x: entries(True, 0, **x), + latestentry=lambda **x: entries(True, 1, **x)) + def branches(web, req, tmpl): tips = (web.repo[n] for t, n in web.repo.branchtags().iteritems()) heads = web.repo.heads() @@ -721,7 +750,8 @@ user = cgi.escape(templatefilters.person(ctx.user())) branch = ctx.branch() branch = branch, web.repo.branchtags().get(branch) == ctx.node() - data.append((node, vtx, edges, desc, user, age, branch, ctx.tags())) + data.append((node, vtx, edges, desc, user, age, branch, ctx.tags(), + ctx.bookmarks())) return tmpl('graph', rev=rev, revcount=revcount, uprev=uprev, lessvars=lessvars, morevars=morevars, downrev=downrev, diff -r 3f6a4579f803 -r 2151703e7f84 mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py Sun Mar 13 12:24:17 2011 +0100 +++ b/mercurial/hgweb/webutil.py Sun Mar 13 13:05:16 2011 +0100 @@ -90,6 +90,9 @@ def nodetagsdict(repo, node): return [{"name": i} for i in repo.nodetags(node)] +def nodebookmarksdict(repo, node): + return [{"name": i} for i in repo.nodebookmarks(node)] + def nodebranchdict(repo, ctx): branches = [] branch = ctx.branch() @@ -118,6 +121,10 @@ for t in repo.nodetags(node): yield tmpl(t1, tag=t, **args) +def showbookmark(repo, tmpl, t1, node=nullid, **args): + for t in repo.nodebookmarks(node): + yield tmpl(t1, bookmark=t, **args) + def cleanpath(repo, path): path = path.lstrip('/') return util.canonpath(repo.root, '', path) diff -r 3f6a4579f803 -r 2151703e7f84 mercurial/templates/paper/bookmarks.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mercurial/templates/paper/bookmarks.tmpl Sun Mar 13 13:05:16 2011 +0100 @@ -0,0 +1,49 @@ +{header} +{repo|escape}: bookmarks + + + + + +
+ + +
+

{repo|escape}

+

bookmarks

+ + + + + + + + +{entries%bookmarkentry} +
bookmarknode
+
+
+ +{footer} diff -r 3f6a4579f803 -r 2151703e7f84 mercurial/templates/paper/branches.tmpl --- a/mercurial/templates/paper/branches.tmpl Sun Mar 13 12:24:17 2011 +0100 +++ b/mercurial/templates/paper/branches.tmpl Sun Mar 13 13:05:16 2011 +0100 @@ -17,6 +17,7 @@
  • log
  • graph
  • tags
  • +
  • bookmarks
  • branches
  • diff -r 3f6a4579f803 -r 2151703e7f84 mercurial/templates/paper/fileannotate.tmpl --- a/mercurial/templates/paper/fileannotate.tmpl Sun Mar 13 12:24:17 2011 +0100 +++ b/mercurial/templates/paper/fileannotate.tmpl Sun Mar 13 13:05:16 2011 +0100 @@ -13,6 +13,7 @@
  • log
  • graph
  • tags
  • +
  • bookmarks
  • branches
  • diff -r 3f6a4579f803 -r 2151703e7f84 mercurial/templates/paper/filediff.tmpl --- a/mercurial/templates/paper/filediff.tmpl Sun Mar 13 12:24:17 2011 +0100 +++ b/mercurial/templates/paper/filediff.tmpl Sun Mar 13 13:05:16 2011 +0100 @@ -13,6 +13,7 @@
  • log
  • graph
  • tags
  • +
  • bookmarks
  • branches
  • diff -r 3f6a4579f803 -r 2151703e7f84 mercurial/templates/paper/shortlog.tmpl --- a/mercurial/templates/paper/shortlog.tmpl Sun Mar 13 12:24:17 2011 +0100 +++ b/mercurial/templates/paper/shortlog.tmpl Sun Mar 13 13:05:16 2011 +0100 @@ -17,6 +17,7 @@
  • log
  • graph
  • tags
  • +
  • bookmarks
  • branches
  • @@ -811,7 +815,7 @@