Patchwork [2,of,2] remotenames: recorded journal entries should be shared like bookmarks

login
register
mail settings
Submitter Martijn Pieters
Date July 1, 2016, 11:57 a.m.
Message ID <9af6c4f6b68c8dbe0448.1467374268@mjpieters-mbp.dhcp.thefacebook.com>
Download mbox | patch
Permalink /patch/15697/
State Accepted
Delegated to: Sean Farley
Headers show

Comments

Martijn Pieters - July 1, 2016, 11:57 a.m.
# HG changeset patch
# User Martijn Pieters <mjpieters@fb.com>
# Date 1467374226 -3600
#      Fri Jul 01 12:57:06 2016 +0100
# Node ID 9af6c4f6b68c8dbe04488847afe5951ea190c9e8
# Parent  765689026f562a92b8eb58f4b4fad28cbbd4009b
remotenames: recorded journal entries should be shared like bookmarks

When a repository is shared between working copies, treat remote names just
like bookmarks as far as sharing journal entries are concerned.

Patch

diff --git a/remotenames.py b/remotenames.py
--- a/remotenames.py
+++ b/remotenames.py
@@ -569,6 +569,16 @@ 
         # histedit isn't on
         pass
 
+    def hasjournal(loaded):
+        if not loaded:
+            return
+        # register our namespace as 'shared' when bookmarks are shared
+        journal = extensions.find('journal')
+        journal.sharednamespaces[journalremotebookmarktype] = (
+            hg.sharedbookmarks)
+
+    extensions.afterloaded('journal', hasjournal)
+
     bookcmd = extensions.wrapcommand(commands.table, 'bookmarks', exbookmarks)
     branchcmd = extensions.wrapcommand(commands.table, 'branches', exbranches)
     pushcmd = extensions.wrapcommand(commands.table, 'push', expushcmd)