D2956: inifnitepush: use utils.{stringutil|procutil}.* instead of util.*

2018-03-30 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0d6c12668691: inifnitepush: use 
utils.{stringutil|procutil}.* instead of util.* (authored by pulkit, committed 
by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2956?vs=7339=7427

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

AFFECTED FILES
  hgext/infinitepush/__init__.py
  hgext/infinitepush/fileindexapi.py

CHANGE DETAILS

diff --git a/hgext/infinitepush/fileindexapi.py 
b/hgext/infinitepush/fileindexapi.py
--- a/hgext/infinitepush/fileindexapi.py
+++ b/hgext/infinitepush/fileindexapi.py
@@ -15,7 +15,7 @@
 
 import os
 
-from mercurial import util
+from mercurial.utils import stringutil
 
 from . import indexapi
 
@@ -77,7 +77,7 @@
 def _listbookmarks(self, pattern):
 if pattern.endswith('*'):
 pattern = 're:^' + pattern[:-1] + '.*'
-kind, pat, matcher = util.stringmatcher(pattern)
+kind, pat, matcher = stringutil.stringmatcher(pattern)
 prefixlen = len(self._bookmarkmap) + 1
 for dirpath, _, books in self._repo.vfs.walk(self._bookmarkmap):
 for book in books:
diff --git a/hgext/infinitepush/__init__.py b/hgext/infinitepush/__init__.py
--- a/hgext/infinitepush/__init__.py
+++ b/hgext/infinitepush/__init__.py
@@ -101,6 +101,11 @@
 
 from mercurial.i18n import _
 
+from mercurial.utils import (
+procutil,
+stringutil,
+)
+
 from mercurial import (
 bundle2,
 changegroup,
@@ -270,7 +275,8 @@
 scratchbranchpat = ui.config('infinitepush', 'branchpattern')
 if scratchbranchpat:
 global _scratchbranchmatcher
-kind, pat, _scratchbranchmatcher = util.stringmatcher(scratchbranchpat)
+kind, pat, _scratchbranchmatcher = \
+stringutil.stringmatcher(scratchbranchpat)
 
 def serverextsetup(ui):
 origpushkeyhandler = bundle2.parthandlermapping['pushkey']
@@ -331,7 +337,7 @@
 results.update(index.getbookmarks(pattern))
 if pattern.endswith('*'):
 pattern = 're:^' + pattern[:-1] + '.*'
-kind, pat, matcher = util.stringmatcher(pattern)
+kind, pat, matcher = stringutil.stringmatcher(pattern)
 for bookmark, node in bookmarks.iteritems():
 if matcher(bookmark):
 results[bookmark] = node
@@ -843,7 +849,7 @@
 if not logger:
 ui = op.repo.ui
 try:
-username = util.getuser()
+username = procutil.getuser()
 except Exception:
 username = 'unknown'
 # Generate random request id to be able to find all logged entries



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


D2956: inifnitepush: use utils.{stringutil|procutil}.* instead of util.*

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

REVISION SUMMARY
  Recently in core, util.py is splitted into various modules in 
mercurial/utils/.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/infinitepush/__init__.py
  hgext/infinitepush/fileindexapi.py

CHANGE DETAILS

diff --git a/hgext/infinitepush/fileindexapi.py 
b/hgext/infinitepush/fileindexapi.py
--- a/hgext/infinitepush/fileindexapi.py
+++ b/hgext/infinitepush/fileindexapi.py
@@ -15,7 +15,7 @@
 
 import os
 
-from mercurial import util
+from mercurial.utils import stringutil
 
 from . import indexapi
 
@@ -77,7 +77,7 @@
 def _listbookmarks(self, pattern):
 if pattern.endswith('*'):
 pattern = 're:^' + pattern[:-1] + '.*'
-kind, pat, matcher = util.stringmatcher(pattern)
+kind, pat, matcher = stringutil.stringmatcher(pattern)
 prefixlen = len(self._bookmarkmap) + 1
 for dirpath, _, books in self._repo.vfs.walk(self._bookmarkmap):
 for book in books:
diff --git a/hgext/infinitepush/__init__.py b/hgext/infinitepush/__init__.py
--- a/hgext/infinitepush/__init__.py
+++ b/hgext/infinitepush/__init__.py
@@ -101,6 +101,11 @@
 
 from mercurial.i18n import _
 
+from mercurial.utils import (
+procutil,
+stringutil,
+)
+
 from mercurial import (
 bundle2,
 changegroup,
@@ -272,7 +277,8 @@
 scratchbranchpat = ui.config('infinitepush', 'branchpattern')
 if scratchbranchpat:
 global _scratchbranchmatcher
-kind, pat, _scratchbranchmatcher = util.stringmatcher(scratchbranchpat)
+kind, pat, _scratchbranchmatcher = \
+stringutil.stringmatcher(scratchbranchpat)
 
 def serverextsetup(ui):
 origpushkeyhandler = bundle2.parthandlermapping['pushkey']
@@ -333,7 +339,7 @@
 results.update(index.getbookmarks(pattern))
 if pattern.endswith('*'):
 pattern = 're:^' + pattern[:-1] + '.*'
-kind, pat, matcher = util.stringmatcher(pattern)
+kind, pat, matcher = stringutil.stringmatcher(pattern)
 for bookmark, node in bookmarks.iteritems():
 if matcher(bookmark):
 results[bookmark] = node
@@ -845,7 +851,7 @@
 if not logger:
 ui = op.repo.ui
 try:
-username = util.getuser()
+username = procutil.getuser()
 except Exception:
 username = 'unknown'
 # Generate random request id to be able to find all logged entries



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