Patchwork [3,of,4,V3] bundle2: add `bookmarks` part handler

login
register
mail settings
Submitter Stanislau Hlebik
Date Aug. 25, 2016, 5:59 p.m.
Message ID <514a4d3a63ff010c3836.1472147990@dev1918.lla1.facebook.com>
Download mbox | patch
Permalink /patch/16417/
State Accepted
Headers show

Comments

Stanislau Hlebik - Aug. 25, 2016, 5:59 p.m.
# HG changeset patch
# User Stanislau Hlebik <stash@fb.com>
# Date 1472147792 25200
#      Thu Aug 25 10:56:32 2016 -0700
# Node ID 514a4d3a63ff010c38361bb922f43febbf5b6d55
# Parent  c38e4fdad4d5ee218b795a9908665484ed996999
bundle2: add `bookmarks` part handler
Augie Fackler - Aug. 29, 2016, 2:08 p.m.
On Thu, Aug 25, 2016 at 10:59:50AM -0700, Stanislau Hlebik wrote:
> # HG changeset patch
> # User Stanislau Hlebik <stash@fb.com>
> # Date 1472147792 25200
> #      Thu Aug 25 10:56:32 2016 -0700
> # Node ID 514a4d3a63ff010c38361bb922f43febbf5b6d55
> # Parent  c38e4fdad4d5ee218b795a9908665484ed996999
> bundle2: add `bookmarks` part handler

It looks like this resolves
https://bz.mercurial-scm.org/show_bug.cgi?id=5165, as there's no
longer a limit that I see on bookmark names. Is that right?


>
> diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
> --- a/mercurial/bundle2.py
> +++ b/mercurial/bundle2.py
> @@ -1610,3 +1610,11 @@
>
>      cache.write()
>      op.ui.debug('applied %i hgtags fnodes cache entries\n' % count)
> +
> +@parthandler('bookmarks')
> +def handlebookmarks(op, inpart):
> +    bookmarks = {}
> +    for bookmarknode in inpart.read().splitlines():
> +        book, node = bookmarknode.rsplit(' ', 1)
> +        bookmarks[book] = node
> +    op.records.add('bookmarks', bookmarks)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -1610,3 +1610,11 @@ 
 
     cache.write()
     op.ui.debug('applied %i hgtags fnodes cache entries\n' % count)
+
+@parthandler('bookmarks')
+def handlebookmarks(op, inpart):
+    bookmarks = {}
+    for bookmarknode in inpart.read().splitlines():
+        book, node = bookmarknode.rsplit(' ', 1)
+        bookmarks[book] = node
+    op.records.add('bookmarks', bookmarks)