[PATCH] revset: add partial support for ancestor(wdir())

2018-06-29 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1530281603 -32400
#  Fri Jun 29 23:13:23 2018 +0900
# Node ID 1a8d711aa48c9f42fdb6b66886685b5d035e7d1e
# Parent  70f7552b82e5f30f9016de57bcd217dc8061c859
revset: add partial support for ancestor(wdir())

It's easy, so let's make it happen. I'm not certain if 'wdir() &' should
be required. ancestors(wdir()) works without it, but ancestor(wdir()) doesn't
as of now. That's the issue of fullreposet.__contains__() vs __and__().

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -319,8 +319,9 @@ def ancestor(repo, subset, x):
 for r in reviter:
 anc = anc.ancestor(repo[r])
 
-if anc.rev() in subset:
-return baseset([anc.rev()])
+r = scmutil.intrev(anc)
+if r in subset:
+return baseset([r])
 return baseset()
 
 def _ancestors(repo, subset, x, followfirst=False, startdepth=None,
diff --git a/tests/test-revset.t b/tests/test-revset.t
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -1813,6 +1813,16 @@ Test working-directory revision
   6
   7
   2147483647
+  $ hg debugrevspec '0:wdir() & ancestor(wdir())'
+  2147483647
+  $ hg debugrevspec '0:wdir() & ancestor(.:wdir())'
+  4
+  $ hg debugrevspec '0:wdir() & ancestor(wdir(), wdir())'
+  2147483647
+  $ hg debugrevspec '0:wdir() & ancestor(wdir(), tip)'
+  4
+  $ hg debugrevspec 'null:wdir() & ancestor(wdir(), null)'
+  -1
   $ hg debugrevspec 'wdir()~0'
   2147483647
   $ hg debugrevspec 'p1(wdir())'
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 2] rebase: convert opts dict to bytes at once

2018-06-29 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1530325985 -32400
#  Sat Jun 30 11:33:05 2018 +0900
# Node ID 70f7552b82e5f30f9016de57bcd217dc8061c859
# Parent  ef5535ebfb4e01e5bd9c28ae03be32902a008e36
rebase: convert opts dict to bytes at once

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -794,29 +794,30 @@ def rebase(ui, repo, **opts):
 unresolved conflicts.
 
 """
+opts = pycompat.byteskwargs(opts)
 inmemory = ui.configbool('rebase', 'experimental.inmemory')
-dryrun = opts.get(r'dry_run')
+dryrun = opts.get('dry_run')
 if dryrun:
-if opts.get(r'abort'):
+if opts.get('abort'):
 raise error.Abort(_('cannot specify both --dry-run and --abort'))
-if opts.get(r'continue'):
+if opts.get('continue'):
 raise error.Abort(_('cannot specify both --dry-run and 
--continue'))
 
-if (opts.get(r'continue') or opts.get(r'abort') or
+if (opts.get('continue') or opts.get('abort') or
 repo.currenttransaction() is not None):
 # in-memory rebase is not compatible with resuming rebases.
 # (Or if it is run within a transaction, since the restart logic can
 # fail the entire transaction.)
 inmemory = False
 
-if opts.get(r'auto_orphans'):
+if opts.get('auto_orphans'):
 for key in opts:
-if key != r'auto_orphans' and opts.get(key):
+if key != 'auto_orphans' and opts.get(key):
 raise error.Abort(_('--auto-orphans is incompatible with %s') %
-  ('--' + pycompat.bytestr(key)))
-userrevs = list(repo.revs(opts.get(r'auto_orphans')))
-opts[r'rev'] = [revsetlang.formatspec('%ld and orphan()', userrevs)]
-opts[r'dest'] = '_destautoorphanrebase(SRC)'
+  ('--' + key))
+userrevs = list(repo.revs(opts.get('auto_orphans')))
+opts['rev'] = [revsetlang.formatspec('%ld and orphan()', userrevs)]
+opts['dest'] = '_destautoorphanrebase(SRC)'
 
 if dryrun:
 return _dryrunrebase(ui, repo, opts)
@@ -830,14 +831,13 @@ def rebase(ui, repo, **opts):
 except error.InMemoryMergeConflictsError:
 ui.warn(_('hit merge conflicts; re-running rebase without 
in-memory'
   ' merge\n'))
-_dorebase(ui, repo, {r'abort': True})
+_dorebase(ui, repo, {'abort': True})
 return _dorebase(ui, repo, opts, inmemory=False)
 else:
 return _dorebase(ui, repo, opts)
 
 def _dryrunrebase(ui, repo, opts):
-rbsrt = rebaseruntime(repo, ui, inmemory=True,
-  opts=pycompat.byteskwargs(opts))
+rbsrt = rebaseruntime(repo, ui, inmemory=True, opts=opts)
 with repo.wlock(), repo.lock():
 try:
 overrides = {('rebase', 'singletransaction'): True}
@@ -856,11 +856,10 @@ def _dryrunrebase(ui, repo, opts):
   suppwarns=True)
 
 def _dorebase(ui, repo, opts, inmemory=False):
-rbsrt = rebaseruntime(repo, ui, inmemory, pycompat.byteskwargs(opts))
+rbsrt = rebaseruntime(repo, ui, inmemory, opts)
 return _origrebase(ui, repo, opts, rbsrt, inmemory=inmemory)
 
 def _origrebase(ui, repo, opts, rbsrt, inmemory=False, leaveunfinished=False):
-opts = pycompat.byteskwargs(opts)
 with repo.wlock(), repo.lock():
 # Validate input and define rebasing points
 destf = opts.get('dest', None)
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3845: worker: support more return types in posix worker

2018-06-29 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >   >   >   I'm not in love with pickle. Could we use json or cbor instead?
  >   >   
  >   >   Perhaps cbor is better since it can be streamed and the overhead is 
pretty
  >   >   low. We have to keep the message size small since rfd/wfd is a 
multi-writer
  >   >   pipe.
  >   
  >   It's been recommended to me that we avoid the streaming flavor of
  >   cbor, so we'd probably just do one-shot messages.
  
  I meant multiple one-shot messages can be serialized over the pipe. JSON 
parser
  doesn't work in that way. Each message must be written atomically.

REPOSITORY
  rHG Mercurial

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

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


Re: D3845: worker: support more return types in posix worker

2018-06-29 Thread Yuya Nishihara
>   >   >   I'm not in love with pickle. Could we use json or cbor instead?
>   >   
>   >   Perhaps cbor is better since it can be streamed and the overhead is 
> pretty
>   >   low. We have to keep the message size small since rfd/wfd is a 
> multi-writer
>   >   pipe.
>   
>   It's been recommended to me that we avoid the streaming flavor of
>   cbor, so we'd probably just do one-shot messages.

I meant multiple one-shot messages can be serialized over the pipe. JSON parser
doesn't work in that way. Each message must be written atomically.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D3845: worker: support more return types in posix worker

2018-06-29 Thread Yuya Nishihara
>   I'm not in love with pickle. Could we use json or cbor instead?

Perhaps cbor is better since it can be streamed and the overhead is pretty
low. We have to keep the message size small since rfd/wfd is a multi-writer
pipe.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3845: worker: support more return types in posix worker

2018-06-29 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >   I'm not in love with pickle. Could we use json or cbor instead?
  
  Perhaps cbor is better since it can be streamed and the overhead is pretty
  low. We have to keep the message size small since rfd/wfd is a multi-writer
  pipe.

REPOSITORY
  rHG Mercurial

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

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


D3854: rebase: add lock to cover whole dryrun process

2018-06-29 Thread yuja (Yuya Nishihara)
yuja added a comment.


  Rebased on top of 
https://phab.mercurial-scm.org/rHG2394cd58b81f77816caf4068ed5e441089460b47 and 
queued, thanks.

REPOSITORY
  rHG Mercurial

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

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


Re: D3854: rebase: add lock to cover whole dryrun process

2018-06-29 Thread Yuya Nishihara
Rebased on top of 2394cd58b81f and queued, thanks.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3855: rebase: extract dryrun as a function

2018-06-29 Thread khanchi97 (Sushil khanchi)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc92fdc27cbdd: rebase: extract dryrun as a function 
(authored by khanchi97, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D3855?vs=9355=9370#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3855?vs=9355=9370

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -818,22 +818,7 @@
 opts[r'dest'] = '_destautoorphanrebase(SRC)'
 
 if dryrun:
-rbsrt = rebaseruntime(repo, ui, inmemory=True,
-  opts=pycompat.byteskwargs(opts))
-with repo.wlock(), repo.lock():
-try:
-overrides = {('rebase', 'singletransaction'): True}
-with ui.configoverride(overrides, 'rebase'):
-_origrebase(ui, repo, inmemory=True, rbsrt=rbsrt,
-leaveunfinished=True, **opts)
-except error.InMemoryMergeConflictsError:
-ui.status(_('hit a merge conflict\n'))
-return 1
-else:
-ui.status(_('there will be no conflict, you can rebase\n'))
-return 0
-finally:
-rbsrt._prepareabortorcontinue(isabort=True)
+return _dryrunrebase(ui, repo, **opts)
 elif inmemory:
 try:
 # in-memory merge doesn't support conflicts, so if we hit any, 
abort
@@ -849,6 +834,24 @@
 else:
 return _origrebase(ui, repo, **opts)
 
+def _dryrunrebase(ui, repo, **opts):
+rbsrt = rebaseruntime(repo, ui, inmemory=True,
+  opts=pycompat.byteskwargs(opts))
+with repo.wlock(), repo.lock():
+try:
+overrides = {('rebase', 'singletransaction'): True}
+with ui.configoverride(overrides, 'rebase'):
+_origrebase(ui, repo, inmemory=True, rbsrt=rbsrt,
+leaveunfinished=True, **opts)
+except error.InMemoryMergeConflictsError:
+ui.status(_('hit a merge conflict\n'))
+return 1
+else:
+ui.status(_('there will be no conflict, you can rebase\n'))
+return 0
+finally:
+rbsrt._prepareabortorcontinue(isabort=True)
+
 def _origrebase(ui, repo, inmemory=False, leaveunfinished=False, rbsrt=None,
 **opts):
 opts = pycompat.byteskwargs(opts)



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


D3857: rebase: suppress warning thrown when aborting rebase in case of dryrun

2018-06-29 Thread khanchi97 (Sushil khanchi)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG999e5c218daf: rebase: suppress warning thrown when aborting 
rebase in case of dryrun (authored by khanchi97, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D3857?vs=9358=9373#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3857?vs=9358=9373

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

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

CHANGE DETAILS

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -212,7 +212,6 @@
   rebasing 3:055a42cdd887 "d"
   rebasing 4:e860deea161a "e"
   there will be no conflict, you can rebase
-  rebase aborted
 
   $ hg diff
   $ hg status
@@ -245,7 +244,6 @@
   rebasing 3:055a42cdd887 "d"
   rebasing 4:e860deea161a "e"
   there will be no conflict, you can rebase
-  rebase aborted
 
 Check dryrun gives correct results when there is conflict in rebasing
 Make a conflict:
@@ -285,7 +283,6 @@
   transaction abort!
   rollback completed
   hit a merge conflict
-  rebase aborted
   [1]
   $ hg diff
   $ hg status
@@ -321,5 +318,4 @@
   rebasing 4:e860deea161a "e"
   merging e
   hit a merge conflict
-  rebase aborted
   [1]
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -325,7 +325,7 @@
 skippedset.update(obsoleteextinctsuccessors)
 _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)
 
-def _prepareabortorcontinue(self, isabort, backup=True):
+def _prepareabortorcontinue(self, isabort, backup=True, suppwarns=False):
 try:
 self.restorestatus()
 self.collapsemsg = restorecollapsemsg(self.repo, isabort)
@@ -342,7 +342,8 @@
 raise error.Abort(msg, hint=hint)
 if isabort:
 return abort(self.repo, self.originalwd, self.destmap, self.state,
- activebookmark=self.activebookmark, backup=backup)
+ activebookmark=self.activebookmark, backup=backup,
+ suppwarns=suppwarns)
 
 def _preparenewrebase(self, destmap):
 if not destmap:
@@ -851,7 +852,8 @@
 return 0
 finally:
 # no need to store backup in case of dryrun
-rbsrt._prepareabortorcontinue(isabort=True, backup=False)
+rbsrt._prepareabortorcontinue(isabort=True, backup=False,
+  suppwarns=True)
 
 def _dorebase(ui, repo, inmemory=False, **opts):
 rbsrt = rebaseruntime(repo, ui, inmemory, pycompat.byteskwargs(opts))
@@ -1554,7 +1556,8 @@
 
 return False
 
-def abort(repo, originalwd, destmap, state, activebookmark=None, backup=True):
+def abort(repo, originalwd, destmap, state, activebookmark=None, backup=True,
+  suppwarns=False):
 '''Restore the repository to its original state.  Additional args:
 
 activebookmark: the name of the bookmark that should be active after the
@@ -1607,7 +1610,8 @@
 finally:
 clearstatus(repo)
 clearcollapsemsg(repo)
-repo.ui.warn(_('rebase aborted\n'))
+if not suppwarns:
+repo.ui.warn(_('rebase aborted\n'))
 return 0
 
 def sortsource(destmap):



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


D3827: rebase: no need to store backup in case of dryrun

2018-06-29 Thread khanchi97 (Sushil khanchi)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc892a30bafb9: rebase: no need to store backup in case of 
dryrun (authored by khanchi97, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D3827?vs=9357=9372#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3827?vs=9357=9372

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

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

CHANGE DETAILS

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -212,7 +212,6 @@
   rebasing 3:055a42cdd887 "d"
   rebasing 4:e860deea161a "e"
   there will be no conflict, you can rebase
-  saved backup bundle to 
$TESTTMP/repo1/repo2/skrepo/.hg/strip-backup/c83b1da5b1ae-f1e0beb9-backup.hg
   rebase aborted
 
   $ hg diff
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -325,7 +325,7 @@
 skippedset.update(obsoleteextinctsuccessors)
 _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)
 
-def _prepareabortorcontinue(self, isabort):
+def _prepareabortorcontinue(self, isabort, backup=True):
 try:
 self.restorestatus()
 self.collapsemsg = restorecollapsemsg(self.repo, isabort)
@@ -341,8 +341,8 @@
 hint = _('use "hg rebase --abort" to clear broken state')
 raise error.Abort(msg, hint=hint)
 if isabort:
-return abort(self.repo, self.originalwd, self.destmap,
- self.state, activebookmark=self.activebookmark)
+return abort(self.repo, self.originalwd, self.destmap, self.state,
+ activebookmark=self.activebookmark, backup=backup)
 
 def _preparenewrebase(self, destmap):
 if not destmap:
@@ -850,7 +850,8 @@
 ui.status(_('there will be no conflict, you can rebase\n'))
 return 0
 finally:
-rbsrt._prepareabortorcontinue(isabort=True)
+# no need to store backup in case of dryrun
+rbsrt._prepareabortorcontinue(isabort=True, backup=False)
 
 def _dorebase(ui, repo, inmemory=False, **opts):
 rbsrt = rebaseruntime(repo, ui, inmemory, pycompat.byteskwargs(opts))
@@ -1553,7 +1554,7 @@
 
 return False
 
-def abort(repo, originalwd, destmap, state, activebookmark=None):
+def abort(repo, originalwd, destmap, state, activebookmark=None, backup=True):
 '''Restore the repository to its original state.  Additional args:
 
 activebookmark: the name of the bookmark that should be active after the
@@ -1598,7 +1599,7 @@
 
 # Strip from the first rebased revision
 if rebased:
-repair.strip(repo.ui, repo, strippoints)
+repair.strip(repo.ui, repo, strippoints, backup=backup)
 
 if activebookmark and activebookmark in repo._bookmarks:
 bookmarks.activate(repo, activebookmark)



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


D3854: rebase: add lock to cover whole dryrun process

2018-06-29 Thread khanchi97 (Sushil khanchi)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGba6d2c32f34a: rebase: add lock to cover whole dryrun 
process (authored by khanchi97, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D3854?vs=9354=9369#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3854?vs=9354=9369

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -818,22 +818,21 @@
 opts[r'dest'] = '_destautoorphanrebase(SRC)'
 
 if dryrun:
-leaveunfinished = True
-inmemory = True
-rbsrt = rebaseruntime(repo, ui, inmemory, pycompat.byteskwargs(opts))
-try:
-overrides = {('rebase', 'singletransaction'): True}
-with ui.configoverride(overrides, 'rebase'):
-_origrebase(ui, repo, inmemory=True, rbsrt=rbsrt,
-leaveunfinished=leaveunfinished, **opts)
-except error.InMemoryMergeConflictsError:
-ui.status(_('hit a merge conflict\n'))
-return 1
-else:
-ui.status(_('there will be no conflict, you can rebase\n'))
-return 0
-finally:
-with repo.wlock(), repo.lock():
+rbsrt = rebaseruntime(repo, ui, inmemory=True,
+  opts=pycompat.byteskwargs(opts))
+with repo.wlock(), repo.lock():
+try:
+overrides = {('rebase', 'singletransaction'): True}
+with ui.configoverride(overrides, 'rebase'):
+_origrebase(ui, repo, inmemory=True, rbsrt=rbsrt,
+leaveunfinished=True, **opts)
+except error.InMemoryMergeConflictsError:
+ui.status(_('hit a merge conflict\n'))
+return 1
+else:
+ui.status(_('there will be no conflict, you can rebase\n'))
+return 0
+finally:
 rbsrt._prepareabortorcontinue(isabort=True)
 elif inmemory:
 try:



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


Re: [PATCH] debugdeltachain: avoid division by zero when a chain is empty

2018-06-29 Thread Yuya Nishihara
On Fri, 29 Jun 2018 18:17:33 +0200, Paul Morelle wrote:
> # HG changeset patch
> # User Paul Morelle 
> # Date 1529597997 -7200
> #  Thu Jun 21 18:19:57 2018 +0200
> # Node ID 9b9cb7abec13ed745c14c3a1357ee2c2dd55c4b5
> # Parent  5d88fd1bc2af0af02129f0ad2b267d778349d95a
> # EXP-Topic debugdeltachain-divbyzero
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
> 9b9cb7abec13
> debugdeltachain: avoid division by zero when a chain is empty
> 
> The two ratios chainratio and extraratio are computed using dividers
> that may be zero when the file is empty.
> As the denominators are integers, the limit of the ratio "just before zero" is
> the numerator value itself.
> If the numerator itself is zero, the ratio value is still meaningful: in both
> cases, a "good" value is a low ratio, and a size of zero is the optimal case.
> 
> diff -r 5d88fd1bc2af -r 9b9cb7abec13 mercurial/debugcommands.py
> --- a/mercurial/debugcommands.py  Sat Jun 16 23:26:40 2018 +0900
> +++ b/mercurial/debugcommands.py  Thu Jun 21 18:19:57 2018 +0200
> @@ -678,8 +678,15 @@
>  except IndexError:
>  prevrev = -1
>  
> -chainratio = float(chainsize) / float(uncomp)
> -extraratio = float(extradist) / float(chainsize)
> +if uncomp != 0:
> +chainratio = float(chainsize) / float(uncomp)
> +else:
> +chainratio = chainsize
> +
> +if chainsize != 0:
> +extraratio = float(extradist) / float(chainsize)
> +else:
> +extraratio = extradist

Seems fine though I don't think the result is 100% correct. Can you add a
test?
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3845: worker: support more return types in posix worker

2018-06-29 Thread durin42 (Augie Fackler)
durin42 added a comment.


  I'm not in love with pickle. Could we use json or cbor instead?

REPOSITORY
  rHG Mercurial

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

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


D3861: scmutil: fix __enter__ in progress context manager

2018-06-29 Thread hooper (Danny Hooper)
hooper created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1328,7 +1328,7 @@
 self.total = total
 
 def __enter__(self):
-pass
+return self
 
 def __exit__(self, exc_type, exc_value, exc_tb):
 self.complete()



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


D3847: fix: disallow 'hg fix --base --whole'

2018-06-29 Thread hooper (Danny Hooper)
hooper updated this revision to Diff 9366.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3847?vs=9319=9366

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

AFFECTED FILES
  hgext/fix.py
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -178,6 +178,9 @@
   abort: no changesets specified
   (use --rev or --working-dir)
   [255]
+  $ hg fix --base 0 --whole --working-dir
+  abort: --base has no meaning in addition to --whole
+  [255]
 
 Fixing a public revision isn't allowed. It should abort early enough that
 nothing happens, even to the working directory.
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -387,6 +387,8 @@
 # The --base flag overrides the usual logic, and we give every revision
 # exactly the set of baserevs that the user specified.
 if opts.get('base'):
+if opts.get('whole'):
+raise error.Abort('--base has no meaning in addition to --whole')
 baserevs = set(scmutil.revrange(repo, opts.get('base')))
 if not baserevs:
 baserevs = {nullrev}



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


D3846: fix: use a worker pool to parallelize running tools

2018-06-29 Thread hooper (Danny Hooper)
hooper updated this revision to Diff 9365.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3846?vs=9318=9365

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -70,6 +70,7 @@
 registrar,
 scmutil,
 util,
+worker,
 )
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' 
for
@@ -138,19 +139,40 @@
 basectxs = getbasectxs(repo, opts, revstofix)
 workqueue, numitems = getworkqueue(ui, repo, pats, opts, revstofix,
basectxs)
+fixers = getfixers(ui)
+
+# There are no data dependencies between the workers fixing each file
+# revision, so we can use all available parallelism.
+def getfixes(items):
+for rev, path in items:
+ctx = repo[rev]
+olddata = ctx[path].data()
+newdata = fixfile(ui, opts, fixers, ctx, path, basectxs[rev])
+# Don't waste memory/time passing unchanged content back, but
+# produce one result per item either way.
+yield (rev, path, newdata if newdata != olddata else None)
+results = worker.worker(ui, 1.0, getfixes, tuple(), workqueue)
+
+# We have to hold on to the data for each successor revision in memory
+# until all its parents are committed. We ensure this by committing and
+# freeing memory for the revisions in some topological order. This
+# leaves a little bit of memory efficiency on the table, but also makes
+# the tests deterministic. It might also be considered a feature since
+# it makes the results more easily reproducible.
 filedata = collections.defaultdict(dict)
 replacements = {}
-fixers = getfixers(ui)
-# Some day this loop can become a worker pool, but for now it's easier
-# to fix everything serially in topological order.
-for rev, path in sorted(workqueue):
-ctx = repo[rev]
-olddata = ctx[path].data()
-newdata = fixfile(ui, opts, fixers, ctx, path, basectxs[rev])
-if newdata != olddata:
+commitorder = sorted(revstofix, reverse=True)
+for rev, path, newdata in results:
+if newdata is not None:
 filedata[rev][path] = newdata
 numitems[rev] -= 1
-if not numitems[rev]:
+# Apply the fixes for this and any other revisions that are ready
+# and sitting at the front of the queue. Using a loop here prevents
+# the queue from being blocked by the first revision to be ready 
out
+# of order.
+while commitorder and not numitems[commitorder[-1]]:
+rev = commitorder.pop()
+ctx = repo[rev]
 if rev == wdirrev:
 writeworkingdir(repo, ctx, filedata[rev], replacements)
 else:
@@ -168,11 +190,19 @@
 topological order. Each work item represents a file in the working copy or
 in some revision that should be fixed and written back to the working copy
 or into a replacement revision.
+
+Work items for the same revision are grouped together, so that a worker
+pool starting with the first N items in parallel is likely to finish the
+first revision's work before other revisions. This can allow us to write
+the result to disk and reduce memory footprint. At time of writing, the
+partition strategy in worker.py seems favorable to this. We also sort the
+items by ascending revision number to match the order in which we commit
+the fixes later.
 """
 workqueue = []
 numitems = collections.defaultdict(int)
 maxfilesize = ui.configbytes('fix', 'maxfilesize')
-for rev in revstofix:
+for rev in sorted(revstofix):
 fixctx = repo[rev]
 match = scmutil.match(fixctx, pats, opts)
 for path in pathstofix(ui, repo, pats, opts, match, basectxs[rev],



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


D3848: fix: add progress bar for number of file revisions processed

2018-06-29 Thread hooper (Danny Hooper)
hooper updated this revision to Diff 9368.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3848?vs=9363=9368

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -162,22 +162,25 @@
 filedata = collections.defaultdict(dict)
 replacements = {}
 commitorder = sorted(revstofix, reverse=True)
-for rev, path, newdata in results:
-if newdata is not None:
-filedata[rev][path] = newdata
-numitems[rev] -= 1
-# Apply the fixes for this and any other revisions that are ready
-# and sitting at the front of the queue. Using a loop here prevents
-# the queue from being blocked by the first revision to be ready 
out
-# of order.
-while commitorder and not numitems[commitorder[-1]]:
-rev = commitorder.pop()
-ctx = repo[rev]
-if rev == wdirrev:
-writeworkingdir(repo, ctx, filedata[rev], replacements)
-else:
-replacerev(ui, repo, ctx, filedata[rev], replacements)
-del filedata[rev]
+with ui.makeprogress(topic=_('fixing'), unit=_('files'),
+ total=sum(numitems.values())) as progress:
+for rev, path, newdata in results:
+progress.increment(item=path)
+if newdata is not None:
+filedata[rev][path] = newdata
+numitems[rev] -= 1
+# Apply the fixes for this and any other revisions that are
+# ready and sitting at the front of the queue. Using a loop 
here
+# prevents the queue from being blocked by the first revision 
to
+# be ready out of order.
+while commitorder and not numitems[commitorder[-1]]:
+rev = commitorder.pop()
+ctx = repo[rev]
+if rev == wdirrev:
+writeworkingdir(repo, ctx, filedata[rev], replacements)
+else:
+replacerev(ui, repo, ctx, filedata[rev], replacements)
+del filedata[rev]
 
 replacements = {prec: [succ] for prec, succ in 
replacements.iteritems()}
 scmutil.cleanupnodes(repo, replacements, 'fix', fixphase=True)



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


D3845: worker: support more return types in posix worker

2018-06-29 Thread hooper (Danny Hooper)
hooper updated this revision to Diff 9364.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3845?vs=9317=9364

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

AFFECTED FILES
  mercurial/worker.py

CHANGE DETAILS

diff --git a/mercurial/worker.py b/mercurial/worker.py
--- a/mercurial/worker.py
+++ b/mercurial/worker.py
@@ -155,8 +155,8 @@
 
 def workerfunc():
 os.close(rfd)
-for i, item in func(*(staticargs + (pargs,))):
-os.write(wfd, '%d %s\n' % (i, item))
+for result in func(*(staticargs + (pargs,))):
+os.write(wfd, util.pickle.dumps(result))
 return 0
 
 ret = scmutil.callcatch(ui, workerfunc)
@@ -187,9 +187,15 @@
 os.kill(os.getpid(), -status)
 sys.exit(status)
 try:
-for line in util.iterfile(fp):
-l = line.split(' ', 1)
-yield int(l[0]), l[1][:-1]
+while True:
+try:
+yield util.pickle.load(fp)
+except EOFError:
+break
+except IOError as e:
+if e.errno == errno.EINTR:
+continue
+raise
 except: # re-raises
 killworkers()
 cleanup()



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


D3848: fix: add progress bar for number of file revisions processed

2018-06-29 Thread hooper (Danny Hooper)
hooper updated this revision to Diff 9363.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3848?vs=9320=9363

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

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -162,22 +162,25 @@
 filedata = collections.defaultdict(dict)
 replacements = {}
 commitorder = sorted(revstofix, reverse=True)
-for rev, path, newdata in results:
-if newdata is not None:
-filedata[rev][path] = newdata
-numitems[rev] -= 1
-# Apply the fixes for this and any other revisions that are ready
-# and sitting at the front of the queue. Using a loop here prevents
-# the queue from being blocked by the first revision to be ready 
out
-# of order.
-while commitorder and not numitems[commitorder[-1]]:
-rev = commitorder.pop()
-ctx = repo[rev]
-if rev == wdirrev:
-writeworkingdir(repo, ctx, filedata[rev], replacements)
-else:
-replacerev(ui, repo, ctx, filedata[rev], replacements)
-del filedata[rev]
+with ui.makeprogress(topic=_('fixing'), unit=_('files'),
+ total=sum(numitems.values())) as progress:
+  for rev, path, newdata in results:
+  progress.increment(item=path)
+  if newdata is not None:
+  filedata[rev][path] = newdata
+  numitems[rev] -= 1
+  # Apply the fixes for this and any other revisions that are ready
+  # and sitting at the front of the queue. Using a loop here 
prevents
+  # the queue from being blocked by the first revision to be ready 
out
+  # of order.
+  while commitorder and not numitems[commitorder[-1]]:
+  rev = commitorder.pop()
+  ctx = repo[rev]
+  if rev == wdirrev:
+  writeworkingdir(repo, ctx, filedata[rev], replacements)
+  else:
+  replacerev(ui, repo, ctx, filedata[rev], replacements)
+  del filedata[rev]
 
 replacements = {prec: [succ] for prec, succ in 
replacements.iteritems()}
 scmutil.cleanupnodes(repo, replacements, 'fix', fixphase=True)



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


D3860: httppeer: fix use of uninitialized variable with devel logging

2018-06-29 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  If the request fails, "res" was uninitialized.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/httppeer.py

CHANGE DETAILS

diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
--- a/mercurial/httppeer.py
+++ b/mercurial/httppeer.py
@@ -306,6 +306,7 @@
 
 start = util.timer()
 
+res = None
 try:
 res = opener.open(req)
 except urlerr.httperror as inst:
@@ -319,8 +320,9 @@
 raise IOError(None, inst)
 finally:
 if ui.debugflag and ui.configbool('devel', 'debug.peer-request'):
+code = res.code if res else -1
 dbg(line % '  finished in %.4f seconds (%d)'
-% (util.timer() - start, res.code))
+% (util.timer() - start, code))
 
 # Insert error handlers for common I/O failures.
 _wraphttpresponse(res)



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


Re: [PATCH 2 of 2] revlog: do inclusive descendant testing (API)

2018-06-29 Thread Martin von Zweigbergk via Mercurial-devel
On Fri, Jun 29, 2018 at 12:42 PM Paul Morelle 
wrote:

> On 27/06/18 19:42, Martin von Zweigbergk wrote:
>
>
>
> On Mon, Jun 25, 2018 at 9:54 AM Paul Morelle 
> wrote:
>
>> On 21/06/18 18:30, Martin von Zweigbergk wrote:
>>
>> On Thu, Jun 21, 2018 at 7:24 AM Paul Morelle 
>> wrote:
>>
>>> # HG changeset patch
>>> # User Boris Feld 
>>> # Date 1529585081 -3600
>>> #  Thu Jun 21 13:44:41 2018 +0100
>>> # Node ID 59fea52e54e014722486f7c049e192fa505032d8
>>> # Parent  8d20b1b4b6a0297e7f9640d285b15a5d6647369e
>>> # EXP-Topic descendant
>>> # Available At https://bitbucket.org/octobus/mercurial-devel/
>>> #  hg pull https://bitbucket.org/octobus/mercurial-devel/
>>> -r 59fea52e54e0
>>> revlog: do inclusive descendant testing (API)
>>>
>>> In many other places, a revision is considered a descendant of itself.
>>> We update the behavior of `revlog.descendant()` to match this.
>>>
>>> No test breaks, so it seems safe to do so.
>>>
>>> diff -r 8d20b1b4b6a0 -r 59fea52e54e0 mercurial/revlog.py
>>> --- a/mercurial/revlog.py   Thu Jun 21 13:32:07 2018 +0100
>>> +++ b/mercurial/revlog.py   Thu Jun 21 13:44:41 2018 +0100
>>> @@ -1378,7 +1378,7 @@
>>>  def descendant(self, start, end):
>>>  if start == nullrev:
>>>  return True
>>> -return start in self.ancestors([end])
>>> +return start in self.ancestors([end], inclusive=True)
>>>
>>
>> Is this now equivalent to self.isancestor(start, end)? That method relies
>> on commonancestorsheads instead of lazyancestors. What are the performance
>> trade-offs? Equivalent both when there are many ancestors and when there
>> are many descendants?
>>
>> Hello Martin,
>>
>> Interestingly, it turns out that we have the following flock of functions:
>>
>>- ancestors: commonancestorsheads(parent_func, *revs)
>>   - uses revnum
>>   - any number of arguments
>>   - written in Python
>>- cext/revlog.c: revlog.index.commonancestorsheads(*revs)
>>   - uses revnum
>>   - any number of arguments
>>   - written in C
>>- revlog: revlog.commonancestorsheads(node-a, node-b)
>>   - uses nodes
>>   - takes exactly two nodes
>>   - Calls either self.index.c…a…heads  or ancestors.c…a…heads
>>- revlog: revlog.isancestor(anc, desc)
>>   - uses nodes
>>   - calls revlog.commonancestorsheads
>>- revlog: revlog.descendant(rev-a, rev-b)
>>   - uses revs
>>   - has it own very slow code
>>- revlog: revlog.descendant(rev-a, rev-b)
>>   - uses revs
>>   - has it own very slow code
>>   - non-inclusive
>>- context: context.descendant(other)
>>   - uses contexts
>>   - calls revlog.descendant
>>   - non-inclusive
>>
>> At the algorithm level, `anc in ancestors(desc)` will be faster when anc
>> is not an ancestor of desc (or they are many gca), since it will finish
>> sooner. However given `commonancestorheads` benefits from a C
>> implementation, it is currently the fastest option.
>>
>> In short terms, I think the following actions would make sense:
>>
>>1. Extract a lower level `revlog._commonancestorheads(*revs)` from
>>`revlog.commonancestorsheads`
>>
>> What would the new function do? commonancestorsheads is already pretty
> short. Do you mean to just make it work on revnums instead of nodeids? Or
> do you mean for making it optionally inclusive?
>
> The new function would operate directly on revision numbers instead of
> converting from/to nodes. The code of revlog.commonancestorsheads would
> then look like this:
>

Sounds good. You can also update rebase.py to use the new function then.


>
> def commonancestorsheads(self, a, b):
> a, b = self.rev(a), self.rev(b)
> ancs = self._commonancestorsheads(a, b)
> return pycompat.maplist(self.node, ancs)
>
>
>>1. Use it in `revlog.descendant`
>>2. Make `revlog.isancestor` use `revlog.descendant`
>>
>> Why is that better than making descendant call isancestor?
>
> isancestor uses nodes, so we first need to convert the node to a rev, and
> then call 'revlog.descendant'
>

I think that makes sense, thanks.


>
> --
> Paul Morelle
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3692: merge: add a 'keepconflictparent' argument to graft

2018-06-29 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd4be8ea8f22d: merge: add a keepconflictparent 
argument to graft (authored by lothiraldan, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3692?vs=8981=9361

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

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -2194,7 +2194,8 @@
   error=stats.unresolvedcount)
 return stats
 
-def graft(repo, ctx, pctx, labels, keepparent=False):
+def graft(repo, ctx, pctx, labels, keepparent=False,
+  keepconflictparent=False):
 """Do a graft-like merge.
 
 This is a merge where the merge ancestor is chosen such that one
@@ -2207,6 +2208,7 @@
 pctx - merge base, usually ctx.p1()
 labels - merge labels eg ['local', 'graft']
 keepparent - keep second parent if any
+keepparent - if unresolved, keep parent used for the merge
 
 """
 # If we're grafting a descendant onto an ancestor, be sure to pass
@@ -2220,11 +,15 @@
 stats = update(repo, ctx.node(), True, True, pctx.node(),
mergeancestor=mergeancestor, labels=labels)
 
-pother = nullid
-parents = ctx.parents()
-if keepparent and len(parents) == 2 and pctx in parents:
-parents.remove(pctx)
-pother = parents[0].node()
+
+if keepconflictparent and stats.unresolvedcount:
+pother = ctx.node()
+else:
+pother = nullid
+parents = ctx.parents()
+if keepparent and len(parents) == 2 and pctx in parents:
+parents.remove(pctx)
+pother = parents[0].node()
 
 with repo.dirstate.parentchange():
 repo.setparents(repo['.'].node(), pother)



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


D3693: shelve: directly handle the initial parent alignment

2018-06-29 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  I am very much happy with the cleanup but I don't feel confident enough to 
push this. Queued https://phab.mercurial-scm.org/D3692.

REPOSITORY
  rHG Mercurial

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

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


D3692: merge: add a 'keepconflictparent' argument to graft

2018-06-29 Thread pulkit (Pulkit Goyal)
pulkit accepted this revision.
pulkit added a comment.


  Looks like this will help fixing issue5927 
 too.

REPOSITORY
  rHG Mercurial

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

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


D3830: rebase: suppress transaction warns during dry-run

2018-06-29 Thread khanchi97 (Sushil khanchi)
khanchi97 updated this revision to Diff 9359.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3830?vs=9347=9359

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

AFFECTED FILES
  hgext/rebase.py
  mercurial/localrepo.py
  mercurial/transaction.py
  tests/test-rebase-inmemory.t

CHANGE DETAILS

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -280,8 +280,6 @@
   rebasing 3:055a42cdd887 "d"
   rebasing 4:e860deea161a "e"
   merging e
-  transaction abort!
-  rollback completed
   hit a merge conflict
   [1]
   $ hg diff
diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -105,7 +105,7 @@
 class transaction(util.transactional):
 def __init__(self, report, opener, vfsmap, journalname, undoname=None,
  after=None, createmode=None, validator=None, releasefn=None,
- checkambigfiles=None, name=r''):
+ checkambigfiles=None, name=r'', suppwarns=False):
 """Begin a new transaction
 
 Begins a new transaction that allows rolling back writes in the event 
of
@@ -133,6 +133,7 @@
 self.map = {}
 self.journal = journalname
 self.undoname = undoname
+self.suppwarns = suppwarns
 self._queue = []
 # A callback to validate transaction content before closing it.
 # should raise exception is anything is wrong.
@@ -570,7 +571,8 @@
 self.opener.unlink(self.journal)
 return
 
-self.report(_("transaction abort!\n"))
+if not self.suppwarns:
+self.report(_("transaction abort!\n"))
 
 try:
 for cat in sorted(self._abortcallback):
@@ -580,7 +582,8 @@
 _playback(self.journal, self.report, self.opener, self._vfsmap,
   self.entries, self._backupentries, False,
   checkambigfiles=self.checkambigfiles)
-self.report(_("rollback completed\n"))
+if not self.suppwarns:
+self.report(_("rollback completed\n"))
 except BaseException:
 self.report(_("rollback failed - please run hg recover\n"))
 finally:
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1224,7 +1224,7 @@
 return tr
 return None
 
-def transaction(self, desc, report=None):
+def transaction(self, desc, report=None, supptrwarns=False):
 if (self.ui.configbool('devel', 'all-warnings')
 or self.ui.configbool('devel', 'check-locks')):
 if self._currentlock(self._lockref) is None:
@@ -1371,7 +1371,8 @@
  validator=validate,
  releasefn=releasefn,
  checkambigfiles=_cachedfiles,
- name=desc)
+ name=desc,
+ suppwarns=supptrwarns)
 tr.changes['revs'] = xrange(0, 0)
 tr.changes['obsmarkers'] = set()
 tr.changes['phases'] = {}
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -842,7 +842,7 @@
 overrides = {('rebase', 'singletransaction'): True}
 with ui.configoverride(overrides, 'rebase'):
 _origrebase(ui, repo, rbsrt, inmemory=True,
-leaveunfinished=True, **opts)
+leaveunfinished=True, supptrwarns=True, **opts)
 except error.InMemoryMergeConflictsError:
 ui.status(_('hit a merge conflict\n'))
 return 1
@@ -859,7 +859,8 @@
 rbsrt = rebaseruntime(repo, ui, inmemory, opts)
 return _origrebase(ui, repo, rbsrt, inmemory=inmemory, **opts)
 
-def _origrebase(ui, repo, rbsrt, inmemory=False, leaveunfinished=False, 
**opts):
+def _origrebase(ui, repo, rbsrt, inmemory=False, leaveunfinished=False,
+supptrwarns=False, **opts):
 with repo.wlock(), repo.lock():
 # Validate input and define rebasing points
 destf = opts.get('dest', None)
@@ -916,7 +917,7 @@
 
 singletr = ui.configbool('rebase', 'singletransaction')
 if singletr:
-tr = repo.transaction('rebase')
+tr = repo.transaction('rebase', supptrwarns=supptrwarns)
 
 # If `rebase.singletransaction` is enabled, wrap the entire operation 
in
 # one transaction here. Otherwise, transactions are obtained when



To: khanchi97, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org

D3764: rebase: improve output of --dry-run

2018-06-29 Thread khanchi97 (Sushil khanchi)
khanchi97 updated this revision to Diff 9360.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3764?vs=9348=9360

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

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

CHANGE DETAILS

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -208,10 +208,11 @@
 
 Check dryrun gives correct results when there is no conflict in rebasing
   $ hg rebase -s 2 -d 6 -n
+  starting dry-run rebase; repository will not be changed
   rebasing 2:177f92b77385 "c"
   rebasing 3:055a42cdd887 "d"
   rebasing 4:e860deea161a "e"
-  there will be no conflict, you can rebase
+  dry-run rebase completed successfully; run without -n/--dry-run to perform 
this rebase
 
   $ hg diff
   $ hg status
@@ -240,10 +241,11 @@
   
 Check dryrun working with --collapse when there is no conflict
   $ hg rebase -s 2 -d 6 -n --collapse
+  starting dry-run rebase; repository will not be changed
   rebasing 2:177f92b77385 "c"
   rebasing 3:055a42cdd887 "d"
   rebasing 4:e860deea161a "e"
-  there will be no conflict, you can rebase
+  dry-run rebase completed successfully; run without -n/--dry-run to perform 
this rebase
 
 Check dryrun gives correct results when there is conflict in rebasing
 Make a conflict:
@@ -276,6 +278,7 @@
  a
   
   $ hg rebase -s 2 -d 7 -n
+  starting dry-run rebase; repository will not be changed
   rebasing 2:177f92b77385 "c"
   rebasing 3:055a42cdd887 "d"
   rebasing 4:e860deea161a "e"
@@ -311,6 +314,7 @@
   
 Check dryrun working with --collapse when there is conflicts
   $ hg rebase -s 2 -d 7 -n --collapse
+  starting dry-run rebase; repository will not be changed
   rebasing 2:177f92b77385 "c"
   rebasing 3:055a42cdd887 "d"
   rebasing 4:e860deea161a "e"
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -837,6 +837,7 @@
 
 def _dryrunrebase(ui, repo, **opts):
 rbsrt = rebaseruntime(repo, ui, inmemory=True, opts=opts)
+ui.status(_('starting dry-run rebase; repository will not be changed\n'))
 with repo.wlock(), repo.lock():
 try:
 overrides = {('rebase', 'singletransaction'): True}
@@ -847,7 +848,8 @@
 ui.status(_('hit a merge conflict\n'))
 return 1
 else:
-ui.status(_('there will be no conflict, you can rebase\n'))
+ui.status(_('dry-run rebase completed successfully; run without'
+' -n/--dry-run to perform this rebase\n'))
 return 0
 finally:
 # no need to store backup in case of dryrun



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


D3827: rebase: no need to store backup in case of dryrun

2018-06-29 Thread khanchi97 (Sushil khanchi)
khanchi97 updated this revision to Diff 9357.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3827?vs=9345=9357

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

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

CHANGE DETAILS

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -212,7 +212,6 @@
   rebasing 3:055a42cdd887 "d"
   rebasing 4:e860deea161a "e"
   there will be no conflict, you can rebase
-  saved backup bundle to 
$TESTTMP/repo1/repo2/skrepo/.hg/strip-backup/c83b1da5b1ae-f1e0beb9-backup.hg
   rebase aborted
 
   $ hg diff
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -325,7 +325,7 @@
 skippedset.update(obsoleteextinctsuccessors)
 _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)
 
-def _prepareabortorcontinue(self, isabort):
+def _prepareabortorcontinue(self, isabort, backup=True):
 try:
 self.restorestatus()
 self.collapsemsg = restorecollapsemsg(self.repo, isabort)
@@ -341,8 +341,8 @@
 hint = _('use "hg rebase --abort" to clear broken state')
 raise error.Abort(msg, hint=hint)
 if isabort:
-return abort(self.repo, self.originalwd, self.destmap,
- self.state, activebookmark=self.activebookmark)
+return abort(self.repo, self.originalwd, self.destmap, self.state,
+ activebookmark=self.activebookmark, backup=backup)
 
 def _preparenewrebase(self, destmap):
 if not destmap:
@@ -849,7 +849,8 @@
 ui.status(_('there will be no conflict, you can rebase\n'))
 return 0
 finally:
-rbsrt._prepareabortorcontinue(isabort=True)
+# no need to store backup in case of dryrun
+rbsrt._prepareabortorcontinue(isabort=True, backup=False)
 
 def _dorebase(ui, repo, inmemory=False, **opts):
 opts = pycompat.byteskwargs(opts)
@@ -1552,7 +1553,7 @@
 
 return False
 
-def abort(repo, originalwd, destmap, state, activebookmark=None):
+def abort(repo, originalwd, destmap, state, activebookmark=None, backup=True):
 '''Restore the repository to its original state.  Additional args:
 
 activebookmark: the name of the bookmark that should be active after the
@@ -1597,7 +1598,7 @@
 
 # Strip from the first rebased revision
 if rebased:
-repair.strip(repo.ui, repo, strippoints)
+repair.strip(repo.ui, repo, strippoints, backup=backup)
 
 if activebookmark and activebookmark in repo._bookmarks:
 bookmarks.activate(repo, activebookmark)



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


D3857: rebase: suppress warning thrown when aborting rebase in case of dryrun

2018-06-29 Thread khanchi97 (Sushil khanchi)
khanchi97 updated this revision to Diff 9358.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3857?vs=9346=9358

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

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

CHANGE DETAILS

diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t
--- a/tests/test-rebase-inmemory.t
+++ b/tests/test-rebase-inmemory.t
@@ -212,7 +212,6 @@
   rebasing 3:055a42cdd887 "d"
   rebasing 4:e860deea161a "e"
   there will be no conflict, you can rebase
-  rebase aborted
 
   $ hg diff
   $ hg status
@@ -245,7 +244,6 @@
   rebasing 3:055a42cdd887 "d"
   rebasing 4:e860deea161a "e"
   there will be no conflict, you can rebase
-  rebase aborted
 
 Check dryrun gives correct results when there is conflict in rebasing
 Make a conflict:
@@ -285,7 +283,6 @@
   transaction abort!
   rollback completed
   hit a merge conflict
-  rebase aborted
   [1]
   $ hg diff
   $ hg status
@@ -321,5 +318,4 @@
   rebasing 4:e860deea161a "e"
   merging e
   hit a merge conflict
-  rebase aborted
   [1]
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -325,7 +325,7 @@
 skippedset.update(obsoleteextinctsuccessors)
 _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)
 
-def _prepareabortorcontinue(self, isabort, backup=True):
+def _prepareabortorcontinue(self, isabort, backup=True, suppwarns=False):
 try:
 self.restorestatus()
 self.collapsemsg = restorecollapsemsg(self.repo, isabort)
@@ -342,7 +342,8 @@
 raise error.Abort(msg, hint=hint)
 if isabort:
 return abort(self.repo, self.originalwd, self.destmap, self.state,
- activebookmark=self.activebookmark, backup=backup)
+ activebookmark=self.activebookmark, backup=backup,
+ suppwarns=suppwarns)
 
 def _preparenewrebase(self, destmap):
 if not destmap:
@@ -850,7 +851,8 @@
 return 0
 finally:
 # no need to store backup in case of dryrun
-rbsrt._prepareabortorcontinue(isabort=True, backup=False)
+rbsrt._prepareabortorcontinue(isabort=True, backup=False,
+  suppwarns=True)
 
 def _dorebase(ui, repo, inmemory=False, **opts):
 opts = pycompat.byteskwargs(opts)
@@ -1553,7 +1555,8 @@
 
 return False
 
-def abort(repo, originalwd, destmap, state, activebookmark=None, backup=True):
+def abort(repo, originalwd, destmap, state, activebookmark=None, backup=True,
+  suppwarns=False):
 '''Restore the repository to its original state.  Additional args:
 
 activebookmark: the name of the bookmark that should be active after the
@@ -1606,7 +1609,8 @@
 finally:
 clearstatus(repo)
 clearcollapsemsg(repo)
-repo.ui.warn(_('rebase aborted\n'))
+if not suppwarns:
+repo.ui.warn(_('rebase aborted\n'))
 return 0
 
 def sortsource(destmap):



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


D3856: rebase: split _origrebase() for conveniece in dryrun

2018-06-29 Thread khanchi97 (Sushil khanchi)
khanchi97 updated this revision to Diff 9356.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3856?vs=9344=9356

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -825,22 +825,22 @@
 # and re-run as an on-disk merge.
 overrides = {('rebase', 'singletransaction'): True}
 with ui.configoverride(overrides, 'rebase'):
-return _origrebase(ui, repo, inmemory=inmemory, **opts)
+return _dorebase(ui, repo, inmemory=inmemory, **opts)
 except error.InMemoryMergeConflictsError:
 ui.warn(_('hit merge conflicts; re-running rebase without 
in-memory'
   ' merge\n'))
-_origrebase(ui, repo, abort=True)
-return _origrebase(ui, repo, inmemory=False, **opts)
+_dorebase(ui, repo, abort=True)
+return _dorebase(ui, repo, inmemory=False, **opts)
 else:
-return _origrebase(ui, repo, **opts)
+return _dorebase(ui, repo, **opts)
 
 def _dryrunrebase(ui, repo, **opts):
 rbsrt = rebaseruntime(repo, ui, inmemory=True, opts=opts)
 with repo.wlock(), repo.lock():
 try:
 overrides = {('rebase', 'singletransaction'): True}
 with ui.configoverride(overrides, 'rebase'):
-_origrebase(ui, repo, inmemory=True, rbsrt=rbsrt,
+_origrebase(ui, repo, rbsrt, inmemory=True,
 leaveunfinished=True, **opts)
 except error.InMemoryMergeConflictsError:
 ui.status(_('hit a merge conflict\n'))
@@ -851,12 +851,12 @@
 finally:
 rbsrt._prepareabortorcontinue(isabort=True)
 
-def _origrebase(ui, repo, inmemory=False, leaveunfinished=False, rbsrt=None,
-**opts):
+def _dorebase(ui, repo, inmemory=False, **opts):
 opts = pycompat.byteskwargs(opts)
-if not rbsrt:
-rbsrt = rebaseruntime(repo, ui, inmemory, opts)
-
+rbsrt = rebaseruntime(repo, ui, inmemory, opts)
+return _origrebase(ui, repo, rbsrt, inmemory=inmemory, **opts)
+
+def _origrebase(ui, repo, rbsrt, inmemory=False, leaveunfinished=False, 
**opts):
 with repo.wlock(), repo.lock():
 # Validate input and define rebasing points
 destf = opts.get('dest', None)



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


D3855: rebase: extract dryrun as a function

2018-06-29 Thread khanchi97 (Sushil khanchi)
khanchi97 updated this revision to Diff 9355.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3855?vs=9343=9355

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -818,21 +818,7 @@
 opts[r'dest'] = '_destautoorphanrebase(SRC)'
 
 if dryrun:
-rbsrt = rebaseruntime(repo, ui, inmemory=True, opts=opts)
-with repo.wlock(), repo.lock():
-try:
-overrides = {('rebase', 'singletransaction'): True}
-with ui.configoverride(overrides, 'rebase'):
-_origrebase(ui, repo, inmemory=True, rbsrt=rbsrt,
-leaveunfinished=True, **opts)
-except error.InMemoryMergeConflictsError:
-ui.status(_('hit a merge conflict\n'))
-return 1
-else:
-ui.status(_('there will be no conflict, you can rebase\n'))
-return 0
-finally:
-rbsrt._prepareabortorcontinue(isabort=True)
+return _dryrunrebase(ui, repo, **opts)
 elif inmemory:
 try:
 # in-memory merge doesn't support conflicts, so if we hit any, 
abort
@@ -848,6 +834,23 @@
 else:
 return _origrebase(ui, repo, **opts)
 
+def _dryrunrebase(ui, repo, **opts):
+rbsrt = rebaseruntime(repo, ui, inmemory=True, opts=opts)
+with repo.wlock(), repo.lock():
+try:
+overrides = {('rebase', 'singletransaction'): True}
+with ui.configoverride(overrides, 'rebase'):
+_origrebase(ui, repo, inmemory=True, rbsrt=rbsrt,
+leaveunfinished=True, **opts)
+except error.InMemoryMergeConflictsError:
+ui.status(_('hit a merge conflict\n'))
+return 1
+else:
+ui.status(_('there will be no conflict, you can rebase\n'))
+return 0
+finally:
+rbsrt._prepareabortorcontinue(isabort=True)
+
 def _origrebase(ui, repo, inmemory=False, leaveunfinished=False, rbsrt=None,
 **opts):
 opts = pycompat.byteskwargs(opts)



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


D3854: rebase: add lock to cover whole dryrun process

2018-06-29 Thread khanchi97 (Sushil khanchi)
khanchi97 updated this revision to Diff 9354.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3854?vs=9342=9354

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -818,22 +818,20 @@
 opts[r'dest'] = '_destautoorphanrebase(SRC)'
 
 if dryrun:
-leaveunfinished = True
-inmemory = True
-rbsrt = rebaseruntime(repo, ui, inmemory, opts)
-try:
-overrides = {('rebase', 'singletransaction'): True}
-with ui.configoverride(overrides, 'rebase'):
-_origrebase(ui, repo, inmemory=True, rbsrt=rbsrt,
-leaveunfinished=leaveunfinished, **opts)
-except error.InMemoryMergeConflictsError:
-ui.status(_('hit a merge conflict\n'))
-return 1
-else:
-ui.status(_('there will be no conflict, you can rebase\n'))
-return 0
-finally:
-with repo.wlock(), repo.lock():
+rbsrt = rebaseruntime(repo, ui, inmemory=True, opts=opts)
+with repo.wlock(), repo.lock():
+try:
+overrides = {('rebase', 'singletransaction'): True}
+with ui.configoverride(overrides, 'rebase'):
+_origrebase(ui, repo, inmemory=True, rbsrt=rbsrt,
+leaveunfinished=True, **opts)
+except error.InMemoryMergeConflictsError:
+ui.status(_('hit a merge conflict\n'))
+return 1
+else:
+ui.status(_('there will be no conflict, you can rebase\n'))
+return 0
+finally:
 rbsrt._prepareabortorcontinue(isabort=True)
 elif inmemory:
 try:



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


D3855: rebase: extract dryrun as a function

2018-06-29 Thread khanchi97 (Sushil khanchi)
khanchi97 added a comment.


  In https://phab.mercurial-scm.org/D3855#60250, @yuja wrote:
  
  > >   rbsrt = rebaseruntime(repo, ui, inmemory, opts)
  > >   with repo.wlock(), repo.lock():
  > >   try:
  > > 
  > > - overrides = {('rebase', 'singletransaction'): True}
  > > - with ui.configoverride(overrides, 'rebase'):
  > > - _origrebase(ui, repo, inmemory=True, rbsrt=rbsrt,
  > > - leaveunfinished=True, **opts) +_dryrunrebase(ui, repo, 
rbsrt, **opts) except error.InMemoryMergeConflictsError: ui.status(_('hit a 
merge conflict\n')) return 1
  >
  > Oops, I meant the whole dryrun process could be extracted to a function
  >  because it's getting bigger.
  >
  >   if dryrun:
  >   return _dryrunrebase(...)
  >   else:
  >   ...
  >
  >
  > But feel free to ignore my suggestion if there's a reason to not move
  >  everything.
  
  
  Aha, I thought you were pointing out to only "try:" block for more no. of 
indented blocks. I will update this.

REPOSITORY
  rHG Mercurial

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

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


[PATCH] debugdeltachain: avoid division by zero when a chain is empty

2018-06-29 Thread Paul Morelle
# HG changeset patch
# User Paul Morelle 
# Date 1529597997 -7200
#  Thu Jun 21 18:19:57 2018 +0200
# Node ID 9b9cb7abec13ed745c14c3a1357ee2c2dd55c4b5
# Parent  5d88fd1bc2af0af02129f0ad2b267d778349d95a
# EXP-Topic debugdeltachain-divbyzero
# Available At https://bitbucket.org/octobus/mercurial-devel/
#  hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 
9b9cb7abec13
debugdeltachain: avoid division by zero when a chain is empty

The two ratios chainratio and extraratio are computed using dividers
that may be zero when the file is empty.
As the denominators are integers, the limit of the ratio "just before zero" is
the numerator value itself.
If the numerator itself is zero, the ratio value is still meaningful: in both
cases, a "good" value is a low ratio, and a size of zero is the optimal case.

diff -r 5d88fd1bc2af -r 9b9cb7abec13 mercurial/debugcommands.py
--- a/mercurial/debugcommands.pySat Jun 16 23:26:40 2018 +0900
+++ b/mercurial/debugcommands.pyThu Jun 21 18:19:57 2018 +0200
@@ -678,8 +678,15 @@
 except IndexError:
 prevrev = -1
 
-chainratio = float(chainsize) / float(uncomp)
-extraratio = float(extradist) / float(chainsize)
+if uncomp != 0:
+chainratio = float(chainsize) / float(uncomp)
+else:
+chainratio = chainsize
+
+if chainsize != 0:
+extraratio = float(extradist) / float(chainsize)
+else:
+extraratio = extradist
 
 fm.startitem()
 fm.write('rev chainid chainlen prevrev deltatype compsize '
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3859: unlinkpath: make empty directory removal optional (issue5901) (issue5826)

2018-06-29 Thread av6 (Anton Shestakov)
av6 added inline comments.

INLINE COMMENTS

> configitems.py:569
>  )
> +coreconfigitem('experimental', 'removeemptydirs',
> +default=True,

Not a huge deal for experimental options, but be aware of 
https://www.mercurial-scm.org/wiki/UIGuideline#naming_config_options (which 
recommends `remove-empty-dirs`).

REPOSITORY
  rHG Mercurial

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

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


D3854: rebase: add lock to cover whole dryrun process

2018-06-29 Thread khanchi97 (Sushil khanchi)
khanchi97 added a comment.


  In https://phab.mercurial-scm.org/D3854#60248, @yuja wrote:
  
  > >   if dryrun:
  > > 
  > > - leaveunfinished = True
  > > - inmemory = True rbsrt = rebaseruntime(repo, ui, inmemory, opts)
  >
  > Perhaps this is wrong. inmemory should be set to True, right?
  
  
  Oops!

REPOSITORY
  rHG Mercurial

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

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


Re: Discussion about Mercurial 4.8 Sprint

2018-06-29 Thread Martin von Zweigbergk via Mercurial-devel
On Fri, Jun 22, 2018, 06:12 Arthur Lutz  wrote:

> Hi,
>
> Since it's my first message on the list, introductions first : I'm Arthur
> Lutz and I work for Logilab. I participated in the last Paris Mercurial
> Sprint and help out Marla with some of the work she does.
>
> On 16/06/2018 23:14, Gregory Szorc wrote:
>
> On Fri, Jun 15, 2018 at 12:20 PM, Augie Fackler  wrote:
>
>>
>>
>> > On Jun 15, 2018, at 10:01, Marla da Silva 
>> wrote:
>> >
>> > And if our office does not suit you, we will be happy to help you to
>> find another place in France.
>>
>> More options is always good!
>>
>> > Thank you for your attention,
>>
>> Thank you for reaching out and the offer! Finding space for sprints is
>> often a challenge.
>>
>
> I think it would be productive if we could easily see a list of everyone's
> location availability and preferences so we can make a more informed
> decision about the location and the trade-offs that would have.
>
> I've updated the people availability table at
> https://www.mercurial-scm.org/wiki/4.8sprint to add columns for location
> availability and preference. Please update the wiki with your availability
> and preference.
>
> There is another location possible in France, in Lyon. Arthur Vuillard[1]
> works in a space in Lyon https://en.wikipedia.org/wiki/Lyon which has a
> larger capacity than our Paris offices.
>
> The description is as follows :
>
> 3 rooms, one for 18, one for 14 and one for 8. The removable walls can be
> moved around to combine either two or theses three spaces. There is a
> coworking space and smaller offices if need for smaller groups. The rooms
> are full equipped (coffee and tea, projectors, screens, etc.). Hotels are
> plenty around the location, as a choice of venues for food.
>
> Direct access from the train stations and one change required from the
> airport.
>
> The following dates are available :
>
> - September 21, 22, 23
> - September 28, 29, 30
> - October 05, 06, 07 (but these are the dates of pyconfr
> https://www.pycon.fr/2018/)
> - October 12, 13, 14
> - October 19, 20, 21
>
> I'll put this information on the wiki.
>

We updated the wiki with availability for Tokyo and Stockholm yesterday.
Could you update the entry for Lyon? Thanks.


> Arthur
>
> [1] President of the AFPY https://www.afpy.org/ which (amongst other
> things) organizes the french version of PyCon. Arthur works for a company
> called Hasbang https://hashbang.fr/
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3855: rebase: extract dryrun as a function

2018-06-29 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >   rbsrt = rebaseruntime(repo, ui, inmemory, opts)
  >   with repo.wlock(), repo.lock():
  >   try:
  > 
  > - overrides = {('rebase', 'singletransaction'): True}
  > - with ui.configoverride(overrides, 'rebase'):
  > - _origrebase(ui, repo, inmemory=True, rbsrt=rbsrt,
  > - leaveunfinished=True, **opts) +_dryrunrebase(ui, repo, 
rbsrt, **opts) except error.InMemoryMergeConflictsError: ui.status(_('hit a 
merge conflict\n')) return 1
  
  Oops, I meant the whole dryrun process could be extracted to a function
  because it's getting bigger.
  
if dryrun:
return _dryrunrebase(...)
else:
...
  
  But feel free to ignore my suggestion if there's a reason to not move
  everything.

REPOSITORY
  rHG Mercurial

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

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


Re: D3855: rebase: extract dryrun as a function

2018-06-29 Thread Yuya Nishihara
>  rbsrt = rebaseruntime(repo, ui, inmemory, opts)
>  with repo.wlock(), repo.lock():
>  try:
> -overrides = {('rebase', 'singletransaction'): True}
> -with ui.configoverride(overrides, 'rebase'):
> -_origrebase(ui, repo, inmemory=True, rbsrt=rbsrt,
> -leaveunfinished=True, **opts)
> +_dryrunrebase(ui, repo, rbsrt, **opts)
>  except error.InMemoryMergeConflictsError:
>  ui.status(_('hit a merge conflict\n'))
>  return 1

Oops, I meant the whole dryrun process could be extracted to a function
because it's getting bigger.

```
if dryrun:
return _dryrunrebase(...)
else:
...
```

But feel free to ignore my suggestion if there's a reason to not move
everything.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3854: rebase: add lock to cover whole dryrun process

2018-06-29 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >   if dryrun:
  > 
  > - leaveunfinished = True
  > - inmemory = True rbsrt = rebaseruntime(repo, ui, inmemory, opts)
  
  Perhaps this is wrong. inmemory should be set to True, right?

REPOSITORY
  rHG Mercurial

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

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


Re: D3854: rebase: add lock to cover whole dryrun process

2018-06-29 Thread Yuya Nishihara
>  if dryrun:
> -leaveunfinished = True
> -inmemory = True
>  rbsrt = rebaseruntime(repo, ui, inmemory, opts)

Perhaps this is wrong. inmemory should be set to True, right?
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3639: remotenames: add paths argument to remotenames revset

2018-06-29 Thread yuja (Yuya Nishihara)
yuja added a comment.


  >   > > +@revsetpredicate('remotenames([path, ...])')
  >   >
  >   > My proposal was `remotenames([pattern])`, just like bookmark(), tag(),
  >   >  branch(), etc.
  >   >  If we want a convenient way to specify path prefix, we can
  >   >  add it to the stringmatcher (e.g. 'remotenames("path:server2")'.)
  >   
  >   
  >   No, I don't want to specify a path prefix. remotenames() will take a path 
only. Do you want to say that we should allow passing full remotenames instead 
of just path?
  
  Yes, because a remote branch is merely a branch pulled from peer for example,
  and we'll probably want to select it by -r remotebranch("foo/bar") just like
  -r branch("foo/bar") for normal branches. Do I get it wrong? Why is it so
  important to filter by a peer path, not by a branch name itself?

REPOSITORY
  rHG Mercurial

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

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


Re: D3639: remotenames: add paths argument to remotenames revset

2018-06-29 Thread Yuya Nishihara
>   > > +@revsetpredicate('remotenames([path, ...])')
>   >
>   > My proposal was `remotenames([pattern])`, just like bookmark(), tag(),
>   >  branch(), etc.
>   >  If we want a convenient way to specify path prefix, we can
>   >  add it to the stringmatcher (e.g. 'remotenames("path:server2")'.)
>   
>   
>   No, I don't want to specify a path prefix. remotenames() will take a path 
> only. Do you want to say that we should allow passing full remotenames 
> instead of just path?

Yes, because a remote branch is merely a branch pulled from peer for example,
and we'll probably want to select it by -r remotebranch("foo/bar") just like
-r branch("foo/bar") for normal branches. Do I get it wrong? Why is it so
important to filter by a peer path, not by a branch name itself?
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3859: unlinkpath: make empty directory removal optional (issue5901) (issue5826)

2018-06-29 Thread spectral (Kyle Lippincott)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGda2a7d8354b2: unlinkpath: make empty directory removal 
optional (issue5901) (issue5826) (authored by spectral, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D3859?vs=9351=9353#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3859?vs=9351=9353

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

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/configitems.py
  mercurial/context.py
  mercurial/patch.py
  mercurial/util.py
  mercurial/vfs.py
  tests/test-removeemptydirs.t

CHANGE DETAILS

diff --git a/tests/test-removeemptydirs.t b/tests/test-removeemptydirs.t
new file mode 100644
--- /dev/null
+++ b/tests/test-removeemptydirs.t
@@ -0,0 +1,242 @@
+Tests for experimental.removeemptydirs
+
+  $ NO_RM=--config=experimental.removeemptydirs=0
+  $ isdir() { if [ -d $1 ]; then echo yes; else echo no; fi }
+  $ isfile() { if [ -f $1 ]; then echo yes; else echo no; fi }
+
+`hg rm` of the last file in a directory:
+  $ hg init hgrm
+  $ cd hgrm
+  $ mkdir somedir
+  $ echo hi > somedir/foo
+  $ hg ci -qAm foo
+  $ isdir somedir
+  yes
+  $ hg rm somedir/foo
+  $ isdir somedir
+  no
+  $ hg revert -qa
+  $ isdir somedir
+  yes
+  $ hg $NO_RM rm somedir/foo
+  $ isdir somedir
+  yes
+  $ ls somedir
+  $ cd $TESTTMP
+
+`hg mv` of the last file in a directory:
+  $ hg init hgmv
+  $ cd hgmv
+  $ mkdir somedir
+  $ mkdir destdir
+  $ echo hi > somedir/foo
+  $ hg ci -qAm foo
+  $ isdir somedir
+  yes
+  $ hg mv somedir/foo destdir/foo
+  $ isdir somedir
+  no
+  $ hg revert -qa
+(revert doesn't get rid of destdir/foo?)
+  $ rm destdir/foo
+  $ isdir somedir
+  yes
+  $ hg $NO_RM mv somedir/foo destdir/foo
+  $ isdir somedir
+  yes
+  $ ls somedir
+  $ cd $TESTTMP
+
+Updating to a commit that doesn't have the directory:
+  $ hg init hgupdate
+  $ cd hgupdate
+  $ echo hi > r0
+  $ hg ci -qAm r0
+  $ mkdir somedir
+  $ echo hi > somedir/foo
+  $ hg ci -qAm r1
+  $ isdir somedir
+  yes
+  $ hg co -q -r ".^"
+  $ isdir somedir
+  no
+  $ hg co -q tip
+  $ isdir somedir
+  yes
+  $ hg $NO_RM co -q -r ".^"
+  $ isdir somedir
+  yes
+  $ ls somedir
+  $ cd $TESTTMP
+
+Rebasing across a commit that doesn't have the directory, from inside the
+directory:
+  $ hg init hgrebase
+  $ cd hgrebase
+  $ echo hi > r0
+  $ hg ci -qAm r0
+  $ mkdir somedir
+  $ echo hi > somedir/foo
+  $ hg ci -qAm first_rebase_source
+  $ hg $NO_RM co -q -r ".^"
+  $ echo hi > somedir/bar
+  $ hg ci -qAm first_rebase_dest
+  $ hg $NO_RM co -q -r ".^"
+  $ echo hi > somedir/baz
+  $ hg ci -qAm second_rebase_dest
+  $ hg co -qr 'desc(first_rebase_source)'
+  $ cd $TESTTMP/hgrebase/somedir
+  $ hg --config extensions.rebase= rebase -qr . -d 'desc(first_rebase_dest)'
+  current directory was removed
+  (consider changing to repo root: $TESTTMP/hgrebase)
+  $ cd $TESTTMP/hgrebase/somedir
+(The current node is the rebased first_rebase_source on top of
+first_rebase_dest)
+This should not output anything about current directory being removed:
+  $ hg $NO_RM --config extensions.rebase= rebase -qr . -d 
'desc(second_rebase_dest)'
+  $ cd $TESTTMP
+
+Histediting across a commit that doesn't have the directory, from inside the
+directory (reordering nodes):
+  $ hg init hghistedit
+  $ cd hghistedit
+  $ echo hi > r0
+  $ hg ci -qAm r0
+  $ echo hi > r1
+  $ hg ci -qAm r1
+  $ echo hi > r2
+  $ hg ci -qAm r2
+  $ mkdir somedir
+  $ echo hi > somedir/foo
+  $ hg ci -qAm migrating_revision
+  $ cat > histedit_commands < pick 89079fab8aee 0 r0
+  > pick e6d271df3142 1 r1
+  > pick 89e25aa83f0f 3 migrating_revision
+  > pick b550aa12d873 2 r2
+  > EOF
+  $ cd $TESTTMP/hghistedit/somedir
+  $ hg --config extensions.histedit= histedit -q --commands 
../histedit_commands
+
+histedit doesn't output anything when the current diretory is removed. We rely
+on the tests being commonly run on machines where the current directory
+disappearing from underneath us actually has an observable effect, such as an
+error or no files listed
+#if linuxormacos
+  $ isfile foo
+  no
+#endif
+  $ cd $TESTTMP/hghistedit/somedir
+  $ isfile foo
+  yes
+
+  $ cd $TESTTMP/hghistedit
+  $ cat > histedit_commands < pick 89079fab8aee 0 r0
+  > pick 7c7a22c6009f 3 migrating_revision
+  > pick e6d271df3142 1 r1
+  > pick 40a53c2d4276 2 r2
+  > EOF
+  $ cd $TESTTMP/hghistedit/somedir
+  $ hg $NO_RM --config extensions.histedit= histedit -q --commands 
../histedit_commands
+Regardless of system, we should always get a 'yes' here.
+  $ isfile foo
+  yes
+  $ cd $TESTTMP
+
+This is essentially the exact test from issue5826, just cleaned up a little:
+
+  $ hg init issue5826_withrm
+  $ cd issue5826_withrm
+
+  $ cat >> $HGRCPATH < [extensions]
+  > histedit =
+  > EOF
+Commit three revisions that each create a directory:
+
+  $ mkdir foo
+  $ touch foo/bar
+  $ hg commit -qAm "add foo"
+
+  $ mkdir bar
+  $ touch bar/bar
+  $ hg commit 

D3853: py3: convert opts keys to bytes using pycompat.byteskwargs()

2018-06-29 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2394cd58b81f: py3: convert opts keys to bytes using 
pycompat.byteskwargs() (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3853?vs=9338=9352

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -820,7 +820,7 @@
 if dryrun:
 leaveunfinished = True
 inmemory = True
-rbsrt = rebaseruntime(repo, ui, inmemory, opts)
+rbsrt = rebaseruntime(repo, ui, inmemory, pycompat.byteskwargs(opts))
 try:
 overrides = {('rebase', 'singletransaction'): True}
 with ui.configoverride(overrides, 'rebase'):



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


Re: D3859: unlinkpath: make empty directory removal optional (issue5901) (issue5826)

2018-06-29 Thread Yuya Nishihara
Queued, thanks.

> +  $ NO_RM=--config=experimental.removeemptydirs=0
> +  $ isdir() { if [[ -d $1 ]]; then echo yes; else echo no; fi }
> +  $ isfile() { if [[ -f $1 ]]; then echo yes; else echo no; fi }

changed to `[ ... ]` since `[[ ... ]]` requires bash.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3859: unlinkpath: make empty directory removal optional (issue5901) (issue5826)

2018-06-29 Thread yuja (Yuya Nishihara)
yuja added a comment.


  Queued, thanks.
  
  > +  $ NO_RM=--config=experimental.removeemptydirs=0
  >  +  $ isdir() { if [[ -d $1 ]]; then echo yes; else echo no; fi }
  >  +  $ isfile() { if [[ -f $1 ]]; then echo yes; else echo no; fi }
  
  changed to `[ ... ]` since `[[ ... ]]` requires bash.

REPOSITORY
  rHG Mercurial

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

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


Re: [PATCH] procutil: add a shim for translating shell commands to native commands

2018-06-29 Thread Yuya Nishihara
On Thu, 28 Jun 2018 22:37:42 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison 
> # Date 1530238988 14400
> #  Thu Jun 28 22:23:08 2018 -0400
> # Node ID 72286f9e324f359d6090ae78883428adc97037cc
> # Parent  5d88fd1bc2af0af02129f0ad2b267d778349d95a
> procutil: add a shim for translating shell commands to native commands

Queued, thanks.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 1 of 2] windows: add a method to convert Unix style command lines to Windows style

2018-06-29 Thread Yuya Nishihara
On Thu, 28 Jun 2018 23:10:33 -0400, Matt Harbison wrote:
> On Thu, 28 Jun 2018 07:49:42 -0400, Yuya Nishihara  wrote:
> 
> > On Wed, 27 Jun 2018 08:44:26 -0400, Matt Harbison wrote:
> >> # HG changeset patch
> >> # User Matt Harbison 
> >> # Date 1529817189 14400
> >> #  Sun Jun 24 01:13:09 2018 -0400
> >> # Node ID 7ac9de5a8826fc95864ee4ba844eb8b5c9e71332
> >> # Parent  2c2e82469b8915c8153979cd89a970b7317f882d
> >> windows: add a method to convert Unix style command lines to Windows  
> >> style
> >
> > Queued, thanks.
> >
> >> +elif c == b'\\' and index + 1 < pathlen and path[index + 1] ==  
> >> b'$':
> >> +# Skip '\', but only if it is escaping $
> >> +res += b'$'
> >> +index += 1
> >
> > \-escape might be confusing since \ is the directory separator on  
> > Windows, and a hook command is likely to contain backslashes.
> 
> Ugh.  I didn't even think about that, though I don't think path components  
> starting with '$' are that common.
> 
> Thinking about this a bit more...
> 
>- Maybe we should drop $$ -> $ too, since that's not what a Unix shell  
> would do, and the point of this is portability.

+1

>- Escaped '$' is a problem for hg -> cmd.exe -> sh.exe.  Consider `hook  
> = echo \$var` in the config file.  This gets passed to cmd.exe as `echo  
> $var`, but that doesn't change if something other than sh.exe runs.
>- I think translating `'` to `"` is the most useful thing to do, but  
> that runs into the same problem.
> 
> What do you think?  Do we need an experimental knob to turn this off?  I'm  
> assuming sh.exe is rare, and there aren't a whole lot of ways to hit this  
> in practice.  I'd prefer it does the sensible thing out of the box.

I think we should do as little shell emulation as possible because it can't
be perfect. Maybe we can leave \$foo unmodified (i.e. no $foo nor \%foo%) as
it is ambiguous?

I'm not so worrying about the hg->cmd.exe->sh thing, but if we add a config
knob, I think per-hook option is nicer.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 3 of 3] revset: move lookup of first ancestor() candidate out of the loop

2018-06-29 Thread Yuya Nishihara
On Thu, 28 Jun 2018 15:48:59 -0700, Martin von Zweigbergk wrote:
> On Thu, Jun 28, 2018 at 6:43 AM Yuya Nishihara  wrote:
> 
> > # HG changeset patch
> > # User Yuya Nishihara 
> > # Date 1529159200 -32400
> > #  Sat Jun 16 23:26:40 2018 +0900
> > # Node ID 0005175b53bb3f829578757c1c34eab60c7c42a8
> > # Parent  fe4560fa5db2f1ee11cff233c55b7685e891517a
> > revset: move lookup of first ancestor() candidate out of the loop
> >
> 
> Queuing this series, thanks.
> 
> What's the motivation for this patch? Does it make some case faster or did
> you just not like the condition inside the loop?

Good question. I just feel initializing variable out of the loop is better.
There's no performance improvement.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel