D2808: remotenames: show remote bookmarks in `hg bookmarks`

2018-03-23 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa61fff493d98: remotenames: show remote bookmarks in `hg 
bookmarks` (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2808?vs=7248=7260

REVISION DETAIL
  https://phab.mercurial-scm.org/D2808

AFFECTED FILES
  hgext/remotenames.py
  tests/test-logexchange.t

CHANGE DETAILS

diff --git a/tests/test-logexchange.t b/tests/test-logexchange.t
--- a/tests/test-logexchange.t
+++ b/tests/test-logexchange.t
@@ -327,3 +327,9 @@
   date:Thu Jan 01 00:00:00 1970 +
   summary: added bar
   
+  $ hg bookmarks
+ $TESTTMP/server2/bar 6:87d6d6676308
+ $TESTTMP/server2/foo 3:62615734edd5
+ default/bar   6:87d6d6676308
+ default/foo   3:62615734edd5
+   * foo   8:3e1487808078
diff --git a/hgext/remotenames.py b/hgext/remotenames.py
--- a/hgext/remotenames.py
+++ b/hgext/remotenames.py
@@ -32,6 +32,8 @@
 bin,
 )
 from mercurial import (
+bookmarks,
+extensions,
 logexchange,
 namespaces,
 pycompat,
@@ -228,6 +230,24 @@
 self._nodetohoists.setdefault(node[0], []).append(name)
 return self._nodetohoists
 
+def wrapprintbookmarks(orig, ui, repo, bmarks, **opts):
+if 'remotebookmarks' not in repo.names:
+return
+ns = repo.names['remotebookmarks']
+
+for name in ns.listnames(repo):
+nodes = ns.nodes(repo, name)
+if not nodes:
+continue
+node = nodes[0]
+
+bmarks[name] = (node, ' ', '')
+
+return orig(ui, repo, bmarks, **opts)
+
+def extsetup(ui):
+extensions.wrapfunction(bookmarks, '_printbookmarks', wrapprintbookmarks)
+
 def reposetup(ui, repo):
 if not repo.local():
 return



To: pulkit, #hg-reviewers, durin42, indygreg
Cc: durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2808: remotenames: show remote bookmarks in `hg bookmarks`

2018-03-22 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 7248.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2808?vs=7102=7248

REVISION DETAIL
  https://phab.mercurial-scm.org/D2808

AFFECTED FILES
  hgext/remotenames.py
  tests/test-logexchange.t

CHANGE DETAILS

diff --git a/tests/test-logexchange.t b/tests/test-logexchange.t
--- a/tests/test-logexchange.t
+++ b/tests/test-logexchange.t
@@ -327,3 +327,9 @@
   date:Thu Jan 01 00:00:00 1970 +
   summary: added bar
   
+  $ hg bookmarks
+ $TESTTMP/server2/bar 6:87d6d6676308
+ $TESTTMP/server2/foo 3:62615734edd5
+ default/bar   6:87d6d6676308
+ default/foo   3:62615734edd5
+   * foo   8:3e1487808078
diff --git a/hgext/remotenames.py b/hgext/remotenames.py
--- a/hgext/remotenames.py
+++ b/hgext/remotenames.py
@@ -32,6 +32,8 @@
 bin,
 )
 from mercurial import (
+bookmarks,
+extensions,
 logexchange,
 namespaces,
 pycompat,
@@ -228,6 +230,24 @@
 self._nodetohoists.setdefault(node[0], []).append(name)
 return self._nodetohoists
 
+def wrapprintbookmarks(orig, ui, repo, bmarks, **opts):
+if 'remotebookmarks' not in repo.names:
+return
+ns = repo.names['remotebookmarks']
+
+for name in ns.listnames(repo):
+nodes = ns.nodes(repo, name)
+if not nodes:
+continue
+node = nodes[0]
+
+bmarks[name] = (node, ' ', '')
+
+return orig(ui, repo, bmarks, **opts)
+
+def extsetup(ui):
+extensions.wrapfunction(bookmarks, '_printbookmarks', wrapprintbookmarks)
+
 def reposetup(ui, repo):
 if not repo.local():
 return



To: pulkit, #hg-reviewers, durin42
Cc: durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2808: remotenames: show remote bookmarks in `hg bookmarks`

2018-03-19 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 7102.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2808?vs=6871=7102

REVISION DETAIL
  https://phab.mercurial-scm.org/D2808

AFFECTED FILES
  hgext/remotenames.py
  tests/test-logexchange.t

CHANGE DETAILS

diff --git a/tests/test-logexchange.t b/tests/test-logexchange.t
--- a/tests/test-logexchange.t
+++ b/tests/test-logexchange.t
@@ -327,3 +327,9 @@
   date:Thu Jan 01 00:00:00 1970 +
   summary: added bar
   
+  $ hg bookmarks
+ $TESTTMP/server2/bar 6:87d6d6676308
+ $TESTTMP/server2/foo 3:62615734edd5
+ default/bar   6:87d6d6676308
+ default/foo   3:62615734edd5
+   * foo   8:3e1487808078
diff --git a/hgext/remotenames.py b/hgext/remotenames.py
--- a/hgext/remotenames.py
+++ b/hgext/remotenames.py
@@ -32,6 +32,8 @@
 bin,
 )
 from mercurial import (
+bookmarks,
+extensions,
 logexchange,
 namespaces,
 pycompat,
@@ -228,6 +230,24 @@
 self._nodetohoists.setdefault(node[0], []).append(name)
 return self._nodetohoists
 
+def wrapprintbookmarks(orig, ui, repo, bmarks, **opts):
+if 'remotebookmarks' not in repo.names:
+return
+ns = repo.names['remotebookmarks']
+
+for name in ns.listnames(repo):
+nodes = ns.nodes(repo, name)
+if not nodes:
+continue
+node = nodes[0]
+
+bmarks[name] = (node, ' ', '')
+
+return orig(ui, repo, bmarks, **opts)
+
+def extsetup(ui):
+extensions.wrapfunction(bookmarks, '_printbookmarks', wrapprintbookmarks)
+
 def reposetup(ui, repo):
 if not repo.local():
 return



To: pulkit, #hg-reviewers, durin42
Cc: durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2808: remotenames: show remote bookmarks in `hg bookmarks`

2018-03-12 Thread durin42 (Augie Fackler)
durin42 accepted this revision as: durin42.
durin42 added a comment.


  Sounds nice.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2808

To: pulkit, #hg-reviewers, durin42
Cc: durin42, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D2808: remotenames: show remote bookmarks in `hg bookmarks`

2018-03-12 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This patch adds functionality to show list of remote bookmarks in `hg 
bookmarks`
  command.
  
  There is some indenting problem in the test output as the current bookmark
  printing code in core can handle bookmark names of size 25 only gracefully.
  
  The idea is taken from hgremotenames extension which has --remote and --all
  flags to show remote bookmarks. However, this patch by defaults support 
showing
  list of remote bookmarks if remotenames extension is enabled and 
remotebookmarks
  are turned on.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2808

AFFECTED FILES
  hgext/remotenames.py
  tests/test-logexchange.t

CHANGE DETAILS

diff --git a/tests/test-logexchange.t b/tests/test-logexchange.t
--- a/tests/test-logexchange.t
+++ b/tests/test-logexchange.t
@@ -327,3 +327,9 @@
   date:Thu Jan 01 00:00:00 1970 +
   summary: added bar
   
+  $ hg bookmarks
+ $TESTTMP/server2/bar 6:87d6d6676308
+ $TESTTMP/server2/foo 3:62615734edd5
+ default/bar   6:87d6d6676308
+ default/foo   3:62615734edd5
+   * foo   8:3e1487808078
diff --git a/hgext/remotenames.py b/hgext/remotenames.py
--- a/hgext/remotenames.py
+++ b/hgext/remotenames.py
@@ -34,6 +34,8 @@
 bin,
 )
 from mercurial import (
+bookmarks,
+extensions,
 logexchange,
 namespaces,
 registrar,
@@ -222,6 +224,24 @@
 self._nodetohoists.setdefault(node[0], []).append(name)
 return self._nodetohoists
 
+def wrapprintbookmarks(orig, ui, repo, bmarks, **opts):
+if 'remotebookmarks' not in repo.names:
+return
+ns = repo.names['remotebookmarks']
+
+for name in ns.listnames(repo):
+nodes = ns.nodes(repo, name)
+if not nodes:
+continue
+node = nodes[0]
+
+bmarks[name] = (node, ' ', '')
+
+return orig(ui, repo, bmarks, **opts)
+
+def extsetup(ui):
+extensions.wrapfunction(bookmarks, '_printbookmarks', wrapprintbookmarks)
+
 def reposetup(ui, repo):
 if not repo.local():
 return



To: pulkit, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel