[PATCH] share: move magic string to a constant

Augie Fackler raf at durin42.com
Mon Jun 27 12:56:02 EDT 2016


I’m a big fan, queued, thanks

> On Jun 24, 2016, at 5:33 AM, Martijn Pieters <mj at zopatista.com> wrote:
> 
> # HG changeset patch
> # User Martijn Pieters <mjpieters at fb.com>
> # Date 1466760758 -3600
> #      Fri Jun 24 10:32:38 2016 +0100
> # Node ID bae1e202268172d2775577c1fece0ad0ad98b6f8
> # Parent  d0ae5b8f80dc115064e66e4ed1dfd848c4f7d1b0
> share: move magic string to a constant
> 
> diff --git a/hgext/share.py b/hgext/share.py
> --- a/hgext/share.py
> +++ b/hgext/share.py
> @@ -135,7 +135,7 @@
>         if inst.errno != errno.ENOENT:
>             raise
>         return False
> -    return 'bookmarks' in shared
> +    return hg.sharedbookmarks in shared
> 
> def _getsrcrepo(repo):
>     """
> diff --git a/mercurial/hg.py b/mercurial/hg.py
> --- a/mercurial/hg.py
> +++ b/mercurial/hg.py
> @@ -44,6 +44,9 @@
> 
> release = lock.release
> 
> +# shared features
> +sharedbookmarks = 'bookmarks'
> +
> def _local(path):
>     path = util.expandpath(util.urllocalpath(path))
>     return (os.path.isfile(path) and bundlerepo or localrepo)
> @@ -258,7 +261,7 @@
> 
>     if bookmarks:
>         fp = destrepo.vfs('shared', 'w')
> -        fp.write('bookmarks\n')
> +        fp.write(sharedbookmarks + '\n')
>         fp.close()
> 
> def _postshareupdate(repo, update, checkout=None):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160627/96f12a20/attachment.sig>


More information about the Mercurial-devel mailing list