D1494: develwarn: do not emit warning if "config" is unspecified

2017-11-22 Thread spectral (Kyle Lippincott)
spectral added a comment.


  (Specifically picked yuja as reviewer since they reviewed the original 
https://www.mercurial-scm.org/repo/hg/rev/3f33831a9202, so hopefully can tell 
me whether this was intentional or not and I'm possibly breaking stuff with 
this change :))

REPOSITORY
  rHG Mercurial

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

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


D1494: develwarn: do not emit warning if "config" is unspecified

2017-11-22 Thread spectral (Kyle Lippincott)
spectral created this revision.
spectral added a reviewer: yuja.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Previously, if the develwarn call site did not specify the category of 
warning,
  and devel.all-warnings was False, it would emit the warning.  If it was
  intended that this emit a warning if config is unspecified, I would have
  expected a comment, so I assumed this was unintentional and am changing the
  behavior.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1601,7 +1601,7 @@
 stack.
 """
 if not self.configbool('devel', 'all-warnings'):
-if config is not None and not self.configbool('devel', config):
+if config is None or not self.configbool('devel', config):
 return
 msg = 'devel-warn: ' + msg
 stacklevel += 1 # get in develwarn



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


D1285: repoview: add a new attribute _visibilityexceptions and related API

2017-11-22 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  In https://phab.mercurial-scm.org/D1285#24461, @quark wrote:
  
  > I think the state of "visibilityexception" should really be bounded into 
whoever controls "filteredrevs", which is the `repoview` object. This allows 
different exceptions to be set for different "repoview" objects backed by a 
same unfiltered repo, which seems more desirable.
  
  
  That's a very good idea. I have split up the series and send the first part 
which adds the functionality.

REPOSITORY
  rHG Mercurial

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

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


D1492: repoview: take out the logic of computehidden to a new function

2017-11-22 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We are going to use that logic in compute functions for the new filternames
  which will be introduced in the next patch. So lets make a utility function
  which takes filtername and can be used by related compute functions.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/repoview.py

CHANGE DETAILS

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -63,24 +63,27 @@
 hidden.remove(p)
 stack.append(p)
 
-def computehidden(repo):
-"""compute the set of hidden revision to filter
-
-During most operation hidden should be filtered."""
-assert not repo.changelog.filteredrevs
-
+def _computeperfiltername(repo, filtername):
+"""computes the set of revisions to filter for visible* filters"""
 hidden = hideablerevs(repo)
 if hidden:
 hidden = set(hidden - pinnedrevs(repo))
-hidden = hidden - repo.filtered('visible').getvisibilityexceptions()
+hidden = hidden - repo.filtered(filtername).getvisibilityexceptions()
 pfunc = repo.changelog.parentrevs
 mutablephases = (phases.draft, phases.secret)
 mutable = repo._phasecache.getrevset(repo, mutablephases)
 
 visible = mutable - hidden
 _revealancestors(pfunc, hidden, visible)
 return frozenset(hidden)
 
+def computehidden(repo):
+"""compute the set of hidden revision to filter
+
+During most operation hidden should be filtered."""
+assert not repo.changelog.filteredrevs
+return _computeperfiltername(repo, 'visible')
+
 def computeunserved(repo):
 """compute the set of revision that should be filtered when used a server
 



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


D1285: repoview: add a new attribute _visibilityexceptions and related API

2017-11-22 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 3784.
pulkit edited the summary of this revision.
pulkit retitled this revision from "localrepo: add a new attribute 
_visibilityexceptions and related API" to "repoview: add a new attribute 
_visibilityexceptions and related API".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1285?vs=3201=3784

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

AFFECTED FILES
  mercurial/localrepo.py
  mercurial/repoview.py

CHANGE DETAILS

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -190,6 +190,8 @@
 object.__setattr__(self, r'filtername', filtername)
 object.__setattr__(self, r'_clcachekey', None)
 object.__setattr__(self, r'_clcache', None)
+# hidden hashes which should be visible
+self._visibilityexceptions = set()
 
 # not a propertycache on purpose we shall implement a proper cache later
 @property
@@ -231,6 +233,14 @@
 return self
 return self.unfiltered().filtered(name)
 
+def addvisibilityexceptions(self, exceptions):
+"""adds hidden revs which should be visible to set of exceptions"""
+self._visibilityexceptions.update(exceptions)
+
+def getvisibilityexceptions(self):
+"""returns the set of hidden revs which should be visible"""
+return self._visibilityexceptions
+
 # everything access are forwarded to the proxied repo
 def __getattr__(self, attr):
 return getattr(self._unfilteredrepo, attr)
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -567,6 +567,14 @@
 def close(self):
 self._writecaches()
 
+def addvisibilityexceptions(self, exceptions):
+# should be called on a filtered repository
+pass
+
+def getvisibilityexceptions(self):
+# should be called on a filtered repository
+return ()
+
 def _loadextensions(self):
 extensions.loadall(self.ui)
 



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


D1287: repoview: add two new filternames to be used for accessing hidden commits

2017-11-22 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 3787.
pulkit edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1287?vs=3207=3787

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

AFFECTED FILES
  mercurial/branchmap.py
  mercurial/repoview.py

CHANGE DETAILS

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -77,6 +77,16 @@
 _revealancestors(pfunc, hidden, visible)
 return frozenset(hidden)
 
+def computewarnhidden(repo):
+""
+assert not repo.changelog.filteredrevs
+return _computeperfiltername(repo, 'visible-warnhidden')
+
+def computeallowhidden(repo):
+""
+assert not repo.changelog.filteredrevs
+return _computeperfiltername(repo, 'visible-allowhidden')
+
 def computehidden(repo):
 """compute the set of hidden revision to filter
 
@@ -143,6 +153,8 @@
 # Otherwise your filter will have to recompute all its branches cache
 # from scratch (very slow).
 filtertable = {'visible': computehidden,
+   'visible-warnhidden': computewarnhidden,
+   'visible-allowhidden': computeallowhidden,
'served': computeunserved,
'immutable':  computemutable,
'base':  computeimpactable}
diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -86,7 +86,9 @@
 subsettable = {None: 'visible',
'visible': 'served',
'served': 'immutable',
-   'immutable': 'base'}
+   'immutable': 'base',
+   'visible-warnhidden': 'visible',
+   'visible-allowhidden': 'visible'}
 
 def updatecache(repo):
 cl = repo.changelog



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


D1286: repoview: consider visibility exceptions in computehidden()

2017-11-22 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 3785.
pulkit edited the summary of this revision.
pulkit retitled this revision from "repoview: also consider visibility 
exceptions in pinnedrevs" to "repoview: consider visibility exceptions in 
computehidden()".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1286?vs=3202=3785

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

AFFECTED FILES
  mercurial/repoview.py

CHANGE DETAILS

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -72,6 +72,7 @@
 hidden = hideablerevs(repo)
 if hidden:
 hidden = set(hidden - pinnedrevs(repo))
+hidden = hidden - repo.filtered('visible').getvisibilityexceptions()
 pfunc = repo.changelog.parentrevs
 mutablephases = (phases.draft, phases.secret)
 mutable = repo._phasecache.getrevset(repo, mutablephases)



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


D1348: histedit: add support to output nodechanges using formatter

2017-11-22 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 3783.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1348?vs=3420=3783

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

AFFECTED FILES
  hgext/histedit.py
  tests/test-histedit-templates.t

CHANGE DETAILS

diff --git a/tests/test-histedit-templates.t b/tests/test-histedit-templates.t
new file mode 100644
--- /dev/null
+++ b/tests/test-histedit-templates.t
@@ -0,0 +1,54 @@
+Testing templating for histedit command
+
+Setup
+
+  $ cat >> $HGRCPATH < [extensions]
+  > histedit=
+  > [experimental]
+  > evolution=createmarkers
+  > EOF
+
+  $ hg init repo
+  $ cd repo
+  $ for ch in a b c d; do echo foo > $ch; hg commit -Aqm "Added "$ch; done
+
+  $ hg log -G -T "{rev}:{node|short} {desc}"
+  @  3:62615734edd5 Added d
+  |
+  o  2:28ad74487de9 Added c
+  |
+  o  1:29becc82797a Added b
+  |
+  o  0:18d04c59bb5d Added a
+  
+Getting the JSON output for nodechanges
+
+  $ hg histedit -Tjson --commands - 2>&1 < pick 28ad74487de9 Added c
+  > pick 62615734edd5 Added d
+  > pick 18d04c59bb5d Added a
+  > pick 29becc82797a Added b
+  > EOF
+  [
+   {
+"nodechanges": {"18d04c59bb5d2d4090ad9a5b59bd6274adb63add": 
["109f8ec895447f81b380ba8d4d8b66539ccdcb94"], 
"28ad74487de9599d00d81085be739c61fc340652": 
["bff9e07c1807942b161dab768aa793b48e9a7f9d"], 
"29becc82797a4bc11ec8880b58eaecd2ab3e7760": 
["f5dcf3b4db23f31f1aacf46c33d1393de303d26f"], 
"62615734edd52f06b6fb9c2beb429e4fe30d57b8": 
["201423b441c84d9e6858daed653e0d22485c1cfa"]}
+   }
+  ]
+
+  $ hg log -G -T "{rev}:{node|short} {desc}"
+  @  7:f5dcf3b4db23 Added b
+  |
+  o  6:109f8ec89544 Added a
+  |
+  o  5:201423b441c8 Added d
+  |
+  o  4:bff9e07c1807 Added c
+  
+  $ hg histedit -T "{nodechanges|json}" --commands - 2>&1 < pick bff9e07c1807 Added c
+  > pick 201423b441c8 Added d
+  > pick 109f8ec89544 Added a
+  > roll f5dcf3b4db23 Added b
+  > EOF
+  {"109f8ec895447f81b380ba8d4d8b66539ccdcb94": 
["8d01470bfeab64d3de13c49adb79d88790d38396"], 
"f3ec56a374bdbdf1953cacca505161442c6f3a3e": [], 
"f5dcf3b4db23f31f1aacf46c33d1393de303d26f": 
["8d01470bfeab64d3de13c49adb79d88790d38396"]} (no-eol)
diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -917,7 +917,8 @@
  ('o', 'outgoing', False, _('changesets not found in destination')),
  ('f', 'force', False,
   _('force outgoing even for unrelated repositories')),
- ('r', 'rev', [], _('first revision to be edited'), _('REV'))],
+ ('r', 'rev', [], _('first revision to be edited'), _('REV'))] +
+  cmdutil.formatteropts,
  _("[OPTIONS] ([ANCESTOR] | --outgoing [URL])"))
 def histedit(ui, repo, *freeargs, **opts):
 """interactively edit changeset history
@@ -1095,6 +1096,8 @@
 
 def _histedit(ui, repo, state, *freeargs, **opts):
 opts = pycompat.byteskwargs(opts)
+fm = ui.formatter('histedit', opts)
+fm.startitem()
 goal = _getgoal(opts)
 revs = opts.get('rev', [])
 rules = opts.get('commands', '')
@@ -1117,7 +1120,8 @@
 _newhistedit(ui, repo, state, revs, freeargs, opts)
 
 _continuehistedit(ui, repo, state)
-_finishhistedit(ui, repo, state)
+_finishhistedit(ui, repo, state, fm)
+fm.end()
 
 def _continuehistedit(ui, repo, state):
 """This function runs after either:
@@ -1164,7 +1168,7 @@
 state.write()
 ui.progress(_("editing"), None)
 
-def _finishhistedit(ui, repo, state):
+def _finishhistedit(ui, repo, state, fm):
 """This action runs when histedit is finishing its session"""
 repo.ui.pushbuffer()
 hg.update(repo, state.parentctxnode, quietempty=True)
@@ -1198,6 +1202,13 @@
 mapping = {k: v for k, v in mapping.items()
if k in nodemap and all(n in nodemap for n in v)}
 scmutil.cleanupnodes(repo, mapping, 'histedit')
+hf = fm.hexfunc
+fl = fm.formatlist
+fd = fm.formatdict
+nodechanges = fd({hf(oldn): fl([hf(n) for n in newn], 'node')
+  for oldn, newn in mapping.iteritems()},
+  key="oldnode", value="newnodes")
+fm.data(nodechanges=nodechanges)
 
 state.clear()
 if os.path.exists(repo.sjoin('undo')):



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


D1063: rebase: enable multidest by default

2017-11-22 Thread quark (Jun Wu)
quark added a comment.


  We have shipped restack based on this code path and haven't heard a problem 
yet.

REPOSITORY
  rHG Mercurial

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

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


D1483: globalopts: make special flags ineffective after '--' (BC)

2017-11-22 Thread quark (Jun Wu)
quark abandoned this revision.
quark added a comment.


  I didn't notice it's fixed in stable. Thanks!

REPOSITORY
  rHG Mercurial

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

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


D1063: rebase: enable multidest by default

2017-11-22 Thread krbullock (Kevin Bullock)
krbullock added a comment.


  @quark @martinvonz Ping

REPOSITORY
  rHG Mercurial

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

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


[PATCH v3] cmdutil: add within-line color diff capacity

2017-11-22 Thread matthieu . laneuville
# HG changeset patch
# User Matthieu Laneuville 
# Date 1508944418 -32400
#  Thu Oct 26 00:13:38 2017 +0900
# Node ID e4b4d581af0fc4e39a28150470b5a658d8315a3f
# Parent  75013952d8d9608f73cd45f68405fbd6ec112bf2
# EXP-Topic hg248
cmdutil: add within-line color diff capacity

The `diff' command usually writes deletion in red and insertions in green. This
patch adds within-line colors, to highlight which part of the lines differ.

The patch passes all tests except `test-diff-color.t' that had to be amended
because of the new default inline coloring.

The current implementation is kept behind an experimental flag in order to test
the effect on performance. In order to activate it, set inline-color-diff to
true in [experimental].

diff -r 75013952d8d9 -r e4b4d581af0f mercurial/cmdutil.py
--- a/mercurial/cmdutil.py  Fri Nov 10 19:14:06 2017 +0800
+++ b/mercurial/cmdutil.py  Thu Oct 26 00:13:38 2017 +0900
@@ -7,6 +7,7 @@
 
 from __future__ import absolute_import
 
+import difflib
 import errno
 import itertools
 import os
@@ -1513,6 +1514,11 @@ def diffordiffstat(ui, repo, diffopts, n
 ui.warn(_('warning: %s not inside relative root %s\n') % (
 match.uipath(matchroot), uirelroot))
 
+store = {
+'diff.inserted': [],
+'diff.deleted': []
+}
+status = False
 if stat:
 diffopts = diffopts.copy(context=0)
 width = 80
@@ -1529,7 +1535,61 @@ def diffordiffstat(ui, repo, diffopts, n
  changes, diffopts, prefix=prefix,
  relroot=relroot,
  hunksfilterfn=hunksfilterfn):
-write(chunk, label=label)
+
+if not ui.configbool("experimental", "inline-color-diff"):
+write(chunk, label=label)
+continue
+
+# Each deleted/inserted chunk is followed by an EOL chunk with ''
+# label. The 'status' flag helps us grab that second line.
+if label in ['diff.deleted', 'diff.inserted'] or status:
+if status:
+store[status].append(chunk)
+status = False
+else:
+store[label].append(chunk)
+status = label
+continue
+
+if store['diff.inserted'] or store['diff.deleted']:
+# It is possible that the amount of deleted/inserted lines
+# differ, therefore we have to pad them before 1-on-1 
comparison
+while len(store['diff.deleted']) < len(store['diff.inserted']):
+store['diff.deleted'].append(None)
+while len(store['diff.deleted']) > len(store['diff.inserted']):
+store['diff.inserted'].append(None)
+
+# First print all deletions
+for insert, delete in zip(store['diff.inserted'],
+  store['diff.deleted']):
+if not delete:
+continue
+if not insert: # no matching insertion, no diff needed
+write(delete, label='diff.deleted')
+
+else:
+buff = _inlinediff(insert, delete, direction='deleted')
+for line in buff:
+write(line[1], label=line[0])
+
+# Then print all deletions
+for insert, delete in zip(store['diff.inserted'],
+  store['diff.deleted']):
+if not insert:
+continue
+if not delete: # no matching insertion, no diff needed
+write(insert, label='diff.inserted')
+
+else:
+buff = _inlinediff(insert, delete, 
direction='inserted')
+for line in buff:
+write(line[1], label=line[0])
+
+store['diff.inserted'] = []
+store['diff.deleted'] = []
+
+if chunk:
+write(chunk, label=label)
 
 if listsubrepos:
 ctx1 = repo[node1]
@@ -1548,6 +1608,23 @@ def diffordiffstat(ui, repo, diffopts, n
 sub.diff(ui, diffopts, tempnode2, submatch, changes=changes,
  stat=stat, fp=fp, prefix=prefix)
 
+def _inlinediff(s1, s2, direction):
+'''Perform string diff to highlight specific changes.'''
+direction_skip = '+?' if direction == 'deleted' else '-?'
+s = difflib.ndiff(s2.split(' '), s1.split(' '))
+# buffer required to remove last space, there may be smarter ways to do 
this
+buff = []
+for line in s:
+if line[0] in direction_skip:
+continue
+l = 'diff.' + direction + '.highlight'
+if line[0] == ' ':
+l = 'diff.' + direction
+  

D1293: rebase: use fm.formatlist() and fm.formatdict() to support user template

2017-11-22 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf56a30b844aa: rebase: use fm.formatlist() and 
fm.formatdict() to support user template (authored by pulkit, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D1293?vs=3725=3767#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1293?vs=3725=3767

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

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-templates.t

CHANGE DETAILS

diff --git a/tests/test-rebase-templates.t b/tests/test-rebase-templates.t
--- a/tests/test-rebase-templates.t
+++ b/tests/test-rebase-templates.t
@@ -54,5 +54,4 @@
   
 
   $ hg rebase -s 6 -d 4 -q -T "{nodechanges % '{oldnode}:{newnodes % ' {node} 
'}'}"
-  d9d6773efc831c274eace04bc13e8e6412517139: 
f48cd65c6dc3d2acb55da54402a5b029546e546f  (no-eol) (false !)
-  d9d6773efc831c274eace04bc13e8e6412517139 (no-eol)
+  d9d6773efc831c274eace04bc13e8e6412517139: 
f48cd65c6dc3d2acb55da54402a5b029546e546f  (no-eol)
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -21,7 +21,6 @@
 
 from mercurial.i18n import _
 from mercurial.node import (
-hex,
 nullid,
 nullrev,
 short,
@@ -1563,8 +1562,12 @@
 replacements[oldnode] = succs
 scmutil.cleanupnodes(repo, replacements, 'rebase', moves)
 if fm:
-nodechanges = {hex(oldn): [hex(n) for n in newn]
-   for oldn, newn in replacements.iteritems()}
+hf = fm.hexfunc
+fl = fm.formatlist
+fd = fm.formatdict
+nodechanges = fd({hf(oldn): fl([hf(n) for n in newn], name='node')
+  for oldn, newn in replacements.iteritems()},
+ key="oldnode", value="newnodes")
 fm.data(nodechanges=nodechanges)
 
 def pullrebase(orig, ui, repo, *args, **opts):



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


D1462: tests: add test for rebase template showing wrong behavior

2017-11-22 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc157bb0120a9: tests: add test for rebase template showing 
wrong behavior (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1462?vs=3724=3766

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

AFFECTED FILES
  tests/test-rebase-templates.t

CHANGE DETAILS

diff --git a/tests/test-rebase-templates.t b/tests/test-rebase-templates.t
--- a/tests/test-rebase-templates.t
+++ b/tests/test-rebase-templates.t
@@ -42,3 +42,17 @@
   
   $ hg rebase -s 1 -d 5 -q -T "{nodechanges|json}"
   {"29becc82797a4bc11ec8880b58eaecd2ab3e7760": 
["d9d6773efc831c274eace04bc13e8e6412517139"]} (no-eol)
+
+  $ hg log -G -T "{rev}:{node|short} {desc}"
+  o  6:d9d6773efc83 Added b
+  |
+  @  5:df21b32134ba Added d
+  |
+  o  4:849767420fd5 Added c
+  |
+  o  0:18d04c59bb5d Added a
+  
+
+  $ hg rebase -s 6 -d 4 -q -T "{nodechanges % '{oldnode}:{newnodes % ' {node} 
'}'}"
+  d9d6773efc831c274eace04bc13e8e6412517139: 
f48cd65c6dc3d2acb55da54402a5b029546e546f  (no-eol) (false !)
+  d9d6773efc831c274eace04bc13e8e6412517139 (no-eol)



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


Re: [POLL] Mass renaming options for consistency + guidelines

2017-11-22 Thread Yuya Nishihara
On Tue, 21 Nov 2017 16:34:20 +0100, Boris Feld wrote:
> On Tue, 2017-11-21 at 22:00 +0900, Yuya Nishihara wrote:
> > On Sun, 19 Nov 2017 05:13:49 +, Martin von Zweigbergk wrote:
> > > On Sat, Nov 18, 2017, 19:22 Yuya Nishihara  wrote:
> > > > On Mon, 13 Nov 2017 22:31:38 +0900, Yuya Nishihara wrote:
> > > > > FWIW, introducing bunch of permanent aliases might not be as
> > > > > simple as it
> > > > > sounds. It will basically add another axis to the current
> > > > > config layer,
> > > > > [global, user, repo] * [oldname, new-name].
> > > > > 
> > > > > Should user's "ui.tweakdefaults" precede global "ui.tweak-
> > > > > defaults" for
> > > > 
> > > > example?
> > > > > Probably it should. Should they both be listed in "hg config"?
> > > > > Maybe,
> > > > 
> > > > but how
> > > > > can we know which is in effect? No idea...
> > > > 
> > > > Any comments on this? With the current alias handling, user
> > > > options may be
> > > > overridden by the global ones if the user is sloppy to keep his
> > > > hgrc up to
> > > > date.
> > > > 
> > > 
> > > I had not realized that it currently works that way. That feels
> > > clearly
> > > wrong to me.
> > > 
> > > It seems to me like we should resolve the aliases per config file
> > > in an
> > > early phase. So global tweakdefaults gets overridden by global
> > > tweak-defaults. User tweakdefaults gets overridden by user tweak-
> > > defaults.
> > > Then the user value overrides the global value as usual.
> > 
> > Yeah, that would be doable and I think is the only way to get around
> > the issue
> > without a large refactoring of ui object. One drawback is "hg config"
> > output
> > could be a bit surprising, e.g. only normalized names displayed, no
> > item matches
> > for "hg config OLD-NAME-OR-SECTION".
> 
> That cannot be done at config reading time as extensions can register
> and update config items after the config is read.

Good catch.

> Looks like we need to teach the config logic about the hierarchy to
> retrieve the right value.

That reminds me of the ui/config layering series Jun sent before.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D1293: rebase: use fm.formatlist() and fm.formatdict() to support user template

2017-11-22 Thread yuja (Yuya Nishihara)
yuja added a comment.


  Queued the series, many thanks.

REPOSITORY
  rHG Mercurial

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

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


D1483: globalopts: make special flags ineffective after '--' (BC)

2017-11-22 Thread yuja (Yuya Nishihara)
yuja requested changes to this revision.
yuja added a comment.
This revision now requires changes to proceed.


  A similar patch is already in stable. Can you send a follow-up if you found
  a problem?
  
  
https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-November/107567.html

REPOSITORY
  rHG Mercurial

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

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


D1460: workers: add config to enable/disable workers

2017-11-22 Thread lothiraldan (Boris Feld)
lothiraldan requested changes to this revision.
lothiraldan added a comment.
This revision now requires changes to proceed.


  Looks good.
  
  We are in the process of registering all the config options in the file named 
`configitems.py` 
(https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/configitems.py#l1132),
 could you update the file with the new option `worker.enabled`. By registering 
the option, we will be able to centralize default values (so you can even 
remove the default value in the `configbol` call) and do nice things like 
validating the user configuration or easily register aliases.

REPOSITORY
  rHG Mercurial

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

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


D1474: run-tests: convert to argparse

2017-11-22 Thread lothiraldan (Boris Feld)
lothiraldan accepted this revision.
lothiraldan added a comment.


  LGTM to me and seems to works fine on Linux.

REPOSITORY
  rHG Mercurial

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

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