D213: evolution: rename trouble(s) to instability

2017-08-02 Thread lothiraldan (Boris Feld)
lothiraldan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Rename trouble(s) to instability in all external user-facing output. Only
  update user-facing output for the moment, variables names, templates keyword
  and potentially configuration would be done in later series.
  
  The renaming is done according to
  https://www.mercurial-scm.org/wiki/CEDVocabulary.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/cmdutil.py
  tests/test-commit-amend.t
  tests/test-obsmarker-template.t

CHANGE DETAILS

diff --git a/tests/test-obsmarker-template.t b/tests/test-obsmarker-template.t
--- a/tests/test-obsmarker-template.t
+++ b/tests/test-obsmarker-template.t
@@ -442,14 +442,14 @@
   |  parent:  0:ea207398892e
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
-  |  trouble: divergent
+  |  instability: divergent
   |  summary: A2
   |
   | o  changeset:   2:fdf9bde5129a
   |/   parent:  0:ea207398892e
   |user:test
   |date:Thu Jan 01 00:00:00 1970 +
-  |trouble: divergent
+  |instability: divergent
   |summary: A1
   |
   | x  changeset:   1:471f378eab4c
@@ -469,7 +469,7 @@
   |  parent:  0:ea207398892e
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
-  |  trouble: divergent
+  |  instability: divergent
   |  summary: A3
   |
   | x  changeset:   3:65b757b745b9
@@ -482,7 +482,7 @@
   |/   parent:  0:ea207398892e
   |user:test
   |date:Thu Jan 01 00:00:00 1970 +
-  |trouble: divergent
+  |instability: divergent
   |summary: A1
   |
   | x  changeset:   1:471f378eab4c
@@ -1086,20 +1086,20 @@
   |  parent:  5:dd800401bd8c
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
-  |  trouble: divergent
+  |  instability: divergent
   |  summary: Add B only
   |
   | o  changeset:   8:b18bc8331526
   |/   parent:  5:dd800401bd8c
   |user:test
   |date:Thu Jan 01 00:00:00 1970 +
-  |trouble: divergent
+  |instability: divergent
   |summary: Add only B
   |
   | o  changeset:   7:ba2ed02b0c9a
   | |  user:test
   | |  date:Thu Jan 01 00:00:00 1970 +
-  | |  trouble: unstable, divergent
+  | |  instability: unstable, divergent
   | |  summary: Add A,B,C
   | |
   | x  changeset:   6:4a004186e638
@@ -,7 +,7 @@
   |  parent:  3:f897c6137566
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
-  |  trouble: divergent
+  |  instability: divergent
   |  summary: Add A,B,C
   |
   o  changeset:   3:f897c6137566
diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t
--- a/tests/test-commit-amend.t
+++ b/tests/test-commit-amend.t
@@ -610,7 +610,7 @@
   parent:  11:3334b7925910
   user:test
   date:Thu Jan 01 00:00:00 1970 +
-  trouble: unstable
+  instability: unstable
   summary: babar
   
 
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1579,7 +1579,7 @@
 
 if ctx.troubled():
 # i18n: column positioning for "hg log"
-self.ui.write(_("trouble: %s\n") % ', '.join(ctx.troubles()),
+self.ui.write(_("instability: %s\n") % ', '.join(ctx.troubles()),
   label='log.trouble')
 
 self._exthook(ctx)



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


D214: evolution: rename unstable to orphan

2017-08-02 Thread lothiraldan (Boris Feld)
lothiraldan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Rename unstable to orphan in all external user-facing output. Only update
  user-facing output for the moment, variables names, templates keyword and
  potentially configuration would be done in later series.
  
  The renaming is done according to
  https://www.mercurial-scm.org/wiki/CEDVocabulary.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/commands.py
  mercurial/context.py
  mercurial/exchange.py
  tests/test-commit-amend.t
  tests/test-obsmarker-template.t
  tests/test-obsolete.t
  tests/test-rebase-obsolete.t

CHANGE DETAILS

diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -793,13 +793,13 @@
   o  0:4a2df7238c3b A
   
   $ hg summary
-  parent: 15:73568ab6879d tip (unstable)
+  parent: 15:73568ab6879d tip (orphan)
bar foo
   branch: default
   commit: (clean)
   update: 2 new changesets, 3 branch heads (merge)
   phases: 8 draft
-  unstable: 1 changesets
+  orphan: 1 changesets
   $ hg rebase -s 10 -d 12
   abort: this rebase will cause divergences from: 121d9e3bc4c6
   (to force the rebase please set experimental.allowdivergence=True)
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -520,15 +520,15 @@
   $ hg log -r 'obsolete()'
   4:94b33453f93b (draft *obsolete*) [ ] add original_d
   $ hg summary
-  parent: 5:cda648ca50f5 tip (unstable)
+  parent: 5:cda648ca50f5 tip (orphan)
add original_e
   branch: default
   commit: (clean)
   update: 1 new changesets, 2 branch heads (merge)
   phases: 3 draft
-  unstable: 1 changesets
+  orphan: 1 changesets
   $ hg log -G -r '::unstable()'
-  @  5:cda648ca50f5 (draft unstable) [tip ] add original_e
+  @  5:cda648ca50f5 (draft orphan) [tip ] add original_e
   |
   x  4:94b33453f93b (draft *obsolete*) [ ] add original_d
   |
@@ -552,7 +552,7 @@
   $ hg push ../tmpc/
   pushing to ../tmpc/
   searching for changes
-  abort: push includes unstable changeset: cda648ca50f5!
+  abort: push includes orphan changeset: cda648ca50f5!
   [255]
 
 Test that extinct changeset are properly detected
@@ -570,7 +570,7 @@
   2:245bde4270cd (public) [ ] add original_c
   3:6f9641995072 (draft) [ ] add n3w_3_c
   4:94b33453f93b (draft *obsolete*) [ ] add original_d
-  5:cda648ca50f5 (draft unstable) [tip ] add original_e
+  5:cda648ca50f5 (draft orphan) [tip ] add original_e
   $ hg push ../tmpf -f # -f because be push unstable too
   pushing to ../tmpf
   searching for changes
@@ -591,7 +591,7 @@
 Do not warn about new head when the new head is a successors of a remote one
 
   $ hg log -G
-  @  5:cda648ca50f5 (draft unstable) [tip ] add original_e
+  @  5:cda648ca50f5 (draft orphan) [tip ] add original_e
   |
   x  4:94b33453f93b (draft *obsolete*) [ ] add original_d
   |
@@ -914,7 +914,7 @@
   changeset:   7:50c51b361e60
   user:test
   date:Thu Jan 01 00:00:00 1970 +
-  trouble: unstable, bumped
+  instability: orphan, bumped
   summary: add babar
   
 
@@ -926,15 +926,15 @@
 test the "troubles" templatekw
 
   $ hg log -r 'bumped() and unstable()'
-  7:50c51b361e60 (draft unstable bumped) [ ] add babar
+  7:50c51b361e60 (draft orphan bumped) [ ] add babar
 
 test the default cmdline template
 
   $ hg log -T default -r 'bumped()'
   changeset:   7:50c51b361e60
   user:test
   date:Thu Jan 01 00:00:00 1970 +
-  trouble: unstable, bumped
+  trouble: orphan, bumped
   summary: add babar
   
   $ hg log -T default -r 'obsolete()'
@@ -950,13 +950,13 @@
   $ hg up -r 'bumped() and unstable()'
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg summary
-  parent: 7:50c51b361e60  (unstable, bumped)
+  parent: 7:50c51b361e60  (orphan, bumped)
add babar
   branch: default
   commit: (clean)
   update: 2 new changesets (update)
   phases: 4 draft
-  unstable: 2 changesets
+  orphan: 2 changesets
   bumped: 1 changesets
   $ hg up -r 'obsolete()'
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -967,7 +967,7 @@
   commit: (clean)
   update: 3 new changesets (update)
   phases: 4 draft
-  unstable: 2 changesets
+  orphan: 2 changesets
   bumped: 1 changesets
 
 Test incoming/outcoming with changesets obsoleted remotely, known locally
diff --git a/tests/test-obsmarker-template.t b/tests/test-obsmarker-template.t
--- a/tests/test-obsmarker-template.t
+++ b/tests/test-obsmarker-template.t
@@ -1099,7 +1099,7 @@
   | o  changeset:   7:ba2ed02b0c9a
   | |  user:test
   | |  date:Thu Jan 01 00:00:00 1970 +
-  | |  instability: unstable, divergent
+  | |  instability: orphan, divergent
   | |  summary: Add A,B,C
   | |
   | x  changeset:   6:4a004186e638
diff --git a/tests/test-commi

D215: evolution: rename divergent to content-divergent

2017-08-02 Thread lothiraldan (Boris Feld)
lothiraldan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Rename divergent to content-divergent in all external user-facing output. Only
  update user-facing output for the moment, variables names, templates keyword
  and potentially configuration would be done in later series.
  
  The renaming is done according to
  https://www.mercurial-scm.org/wiki/CEDVocabulary.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/commands.py
  mercurial/context.py
  mercurial/exchange.py
  tests/test-obsmarker-template.t
  tests/test-obsolete-divergent.t
  tests/test-rebase-obsolete.t

CHANGE DETAILS

diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -833,7 +833,7 @@
   commit: (clean)
   update: 1 new changesets, 2 branch heads (merge)
   phases: 8 draft
-  divergent: 2 changesets
+  content-divergent: 2 changesets
 
 rebase --continue + skipped rev because their successors are in destination
 we make a change in trunk and work on conflicting changes to make rebase abort.
diff --git a/tests/test-obsolete-divergent.t b/tests/test-obsolete-divergent.t
--- a/tests/test-obsolete-divergent.t
+++ b/tests/test-obsolete-divergent.t
@@ -107,7 +107,7 @@
   $ hg push ../other
   pushing to ../other
   searching for changes
-  abort: push includes divergent changeset: 392fd25390da!
+  abort: push includes content-divergent changeset: 392fd25390da!
   [255]
 
   $ cd ..
@@ -671,9 +671,9 @@
   $ rm .hg/localtags
   $ hg cleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
   $ hg log -G -T '{rev}:{node|short} {desc} {troubles}' -r 'sort(all(), topo)'
-  @  5:1a2a9b5b0030 B2 divergent
-  |
-  | o  4:70d5a63ca112 B4 divergent
+  @  5:1a2a9b5b0030 B2 content-divergent
+  |
+  | o  4:70d5a63ca112 B4 content-divergent
   | |
   | o  1:48b9aae0607f Z
   |
diff --git a/tests/test-obsmarker-template.t b/tests/test-obsmarker-template.t
--- a/tests/test-obsmarker-template.t
+++ b/tests/test-obsmarker-template.t
@@ -442,14 +442,14 @@
   |  parent:  0:ea207398892e
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
-  |  instability: divergent
+  |  instability: content-divergent
   |  summary: A2
   |
   | o  changeset:   2:fdf9bde5129a
   |/   parent:  0:ea207398892e
   |user:test
   |date:Thu Jan 01 00:00:00 1970 +
-  |instability: divergent
+  |instability: content-divergent
   |summary: A1
   |
   | x  changeset:   1:471f378eab4c
@@ -469,7 +469,7 @@
   |  parent:  0:ea207398892e
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
-  |  instability: divergent
+  |  instability: content-divergent
   |  summary: A3
   |
   | x  changeset:   3:65b757b745b9
@@ -482,7 +482,7 @@
   |/   parent:  0:ea207398892e
   |user:test
   |date:Thu Jan 01 00:00:00 1970 +
-  |instability: divergent
+  |instability: content-divergent
   |summary: A1
   |
   | x  changeset:   1:471f378eab4c
@@ -1086,20 +1086,20 @@
   |  parent:  5:dd800401bd8c
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
-  |  instability: divergent
+  |  instability: content-divergent
   |  summary: Add B only
   |
   | o  changeset:   8:b18bc8331526
   |/   parent:  5:dd800401bd8c
   |user:test
   |date:Thu Jan 01 00:00:00 1970 +
-  |instability: divergent
+  |instability: content-divergent
   |summary: Add only B
   |
   | o  changeset:   7:ba2ed02b0c9a
   | |  user:test
   | |  date:Thu Jan 01 00:00:00 1970 +
-  | |  instability: orphan, divergent
+  | |  instability: orphan, content-divergent
   | |  summary: Add A,B,C
   | |
   | x  changeset:   6:4a004186e638
@@ -,7 +,7 @@
   |  parent:  3:f897c6137566
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
-  |  instability: divergent
+  |  instability: content-divergent
   |  summary: Add A,B,C
   |
   o  changeset:   3:f897c6137566
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -677,9 +677,10 @@
 if unfi.obsstore:
 # this message are here for 80 char limit reason
 mso = _("push includes obsolete changeset: %s!")
+mscd = _("push includes content-divergent changeset: %s!")
 mst = {"orphan": _("push includes orphan changeset: %s!"),
"bumped": _("push includes bumped changeset: %s!"),
-   "divergent": _("push includes divergent changeset: %s!")}
+   "content-divergent": mscd}
 # If we are to push if there is at least one
 # obsolete or unstable changeset in missing, at
 # least one of the missinghe

D216: evolution: rename bumped to phase-divergent

2017-08-02 Thread lothiraldan (Boris Feld)
lothiraldan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Rename bumped to phase-divergent in all external user-facing output. Only
  update user-facing output for the moment, variables names, templates keyword
  and potentially configuration would be done in later series.
  
  The renaming is done according to
  https://www.mercurial-scm.org/wiki/CEDVocabulary.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/commands.py
  mercurial/context.py
  mercurial/exchange.py
  tests/test-obsolete.t

CHANGE DETAILS

diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -207,7 +207,7 @@
 
   $ hg --hidden phase --public 2
   $ hg log -G
-  @  5:5601fb93a350 (draft bumped) [tip ] add new_3_c
+  @  5:5601fb93a350 (draft phase-divergent) [tip ] add new_3_c
   |
   | o  2:245bde4270cd (public) [ ] add original_c
   |/
@@ -224,7 +224,7 @@
 the public changeset
 
   $ hg log --hidden -r 'bumped()'
-  5:5601fb93a350 (draft bumped) [tip ] add new_3_c
+  5:5601fb93a350 (draft phase-divergent) [tip ] add new_3_c
 
 And that we can't push bumped changeset
 
@@ -239,20 +239,20 @@
   $ hg push ../tmpa
   pushing to ../tmpa
   searching for changes
-  abort: push includes bumped changeset: 5601fb93a350!
+  abort: push includes phase-divergent changeset: 5601fb93a350!
   [255]
 
 Fixing "bumped" situation
 We need to create a clone of 5 and add a special marker with a flag
 
   $ hg summary
-  parent: 5:5601fb93a350 tip (bumped)
+  parent: 5:5601fb93a350 tip (phase-divergent)
add new_3_c
   branch: default
   commit: (clean)
   update: 1 new changesets, 2 branch heads (merge)
   phases: 1 draft
-  bumped: 1 changesets
+  phase-divergent: 1 changesets
   $ hg up '5^'
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg revert -ar 5
@@ -914,7 +914,7 @@
   changeset:   7:50c51b361e60
   user:test
   date:Thu Jan 01 00:00:00 1970 +
-  instability: orphan, bumped
+  instability: orphan, phase-divergent
   summary: add babar
   
 
@@ -926,15 +926,15 @@
 test the "troubles" templatekw
 
   $ hg log -r 'bumped() and unstable()'
-  7:50c51b361e60 (draft orphan bumped) [ ] add babar
+  7:50c51b361e60 (draft orphan phase-divergent) [ ] add babar
 
 test the default cmdline template
 
   $ hg log -T default -r 'bumped()'
   changeset:   7:50c51b361e60
   user:test
   date:Thu Jan 01 00:00:00 1970 +
-  trouble: orphan, bumped
+  trouble: orphan, phase-divergent
   summary: add babar
   
   $ hg log -T default -r 'obsolete()'
@@ -950,14 +950,14 @@
   $ hg up -r 'bumped() and unstable()'
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg summary
-  parent: 7:50c51b361e60  (orphan, bumped)
+  parent: 7:50c51b361e60  (orphan, phase-divergent)
add babar
   branch: default
   commit: (clean)
   update: 2 new changesets (update)
   phases: 4 draft
   orphan: 2 changesets
-  bumped: 1 changesets
+  phase-divergent: 1 changesets
   $ hg up -r 'obsolete()'
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg summary
@@ -968,7 +968,7 @@
   update: 3 new changesets (update)
   phases: 4 draft
   orphan: 2 changesets
-  bumped: 1 changesets
+  phase-divergent: 1 changesets
 
 Test incoming/outcoming with changesets obsoleted remotely, known locally
 ===
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -677,9 +677,10 @@
 if unfi.obsstore:
 # this message are here for 80 char limit reason
 mso = _("push includes obsolete changeset: %s!")
+mspd = _("push includes phase-divergent changeset: %s!")
 mscd = _("push includes content-divergent changeset: %s!")
 mst = {"orphan": _("push includes orphan changeset: %s!"),
-   "bumped": _("push includes bumped changeset: %s!"),
+   "phase-divergent": mspd,
"content-divergent": mscd}
 # If we are to push if there is at least one
 # obsolete or unstable changeset in missing, at
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -230,14 +230,14 @@
 
 Troubles are returned as strings. possible values are:
 - orphan,
-- bumped,
+- phase-divergent,
 - content-divergent.
 """
 troubles = []
 if self.unstable():
 troubles.append('orphan')
 if self.bumped():
-troubles.append('bumped')
+troubles.append('phase-divergent')
 if self.divergent():
 troubles.append('content-divergent')
 return troubles
diff -

[PATCH STABLE] ui: enable pager always for explicit --pager=on (issue5580)

2017-08-02 Thread FUJIWARA Katsunori
# HG changeset patch
# User FUJIWARA Katsunori 
# Date 1501581172 -32400
#  Tue Aug 01 18:52:52 2017 +0900
# Branch stable
# Node ID e9883ae6e2d70b0f78ec8c8953b47130ecba3f07
# Parent  76b171209151fe41dbf8dbfec473cc533f3b40ca
# Available At https://bitbucket.org/foozy/mercurial-wip
#  hg pull https://bitbucket.org/foozy/mercurial-wip -r e9883ae6e2d7
# EXP-Topic issue5580
ui: enable pager always for explicit --pager=on (issue5580)

Before this patch, explicit --pager=on is unintentionally ignored by
any disabling factor, even if priority of it is less than --pager=on
(e.g. "[ui] paginate = off").

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -828,6 +828,7 @@ def _dispatch(req):
 color.setup(ui_)
 
 if util.parsebool(options['pager']):
+# ui.pager() expects 'internal-always-' prefix in this case
 ui.pager('internal-always-' + cmd)
 elif options['pager'] != 'auto':
 ui.disablepager()
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -945,8 +945,14 @@ class ui(object):
not "history, "summary" not "summ", etc.
 """
 if (self._disablepager
-or self.pageractive
-or command in self.configlist('pager', 'ignore')
+or self.pageractive):
+# how pager should do is already determined
+return
+
+if not command.startswith('internal-always-') and (
+# explicit --pager=on (= 'internal-always-' prefix) should
+# take precedence over disabling factors below
+command in self.configlist('pager', 'ignore')
 or not self.configbool('ui', 'paginate')
 or not self.configbool('pager', 'attend-' + command, True)
 # TODO: if we want to allow HGPLAINEXCEPT=pager,
diff --git a/tests/test-pager.t b/tests/test-pager.t
--- a/tests/test-pager.t
+++ b/tests/test-pager.t
@@ -80,6 +80,34 @@ We can control the pager from the config
   paged! 'summary: modify a 10\n'
   paged! '\n'
 
+explicit --pager=on should take precedence over other configurations
+(issue5580)
+
+  $ cat >> $HGRCPATH < [ui]
+  > paginate = false
+  > EOF
+  $ hg log --limit 1 --pager=on
+  paged! 'changeset:   10:46106edeeb38\n'
+  paged! 'tag: tip\n'
+  paged! 'user:test\n'
+  paged! 'date:Thu Jan 01 00:00:00 1970 +\n'
+  paged! 'summary: modify a 10\n'
+  paged! '\n'
+
+  $ cat >> $HGRCPATH < [ui]
+  > # true is default value of ui.paginate
+  > paginate = true
+  > EOF
+  $ hg log --limit 1 --pager=off
+  changeset:   10:46106edeeb38
+  tag: tip
+  user:test
+  date:Thu Jan 01 00:00:00 1970 +
+  summary: modify a 10
+  
+
 We can enable the pager on id:
 
 BROKEN: should be paged
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH STABLE] i18n: use actual filename, in which function is defined, for hg.pot

2017-08-02 Thread FUJIWARA Katsunori
# HG changeset patch
# User FUJIWARA Katsunori 
# Date 1501599731 -32400
#  Wed Aug 02 00:02:11 2017 +0900
# Branch stable
# Node ID b6d0bcd19b4dffb2360f909f459c27104ad16565
# Parent  76b171209151fe41dbf8dbfec473cc533f3b40ca
# Available At https://bitbucket.org/foozy/mercurial-wip
#  hg pull https://bitbucket.org/foozy/mercurial-wip -r b6d0bcd19b4d
# EXP-Topic i18n-fix-update-pot-issues
i18n: use actual filename, in which function is defined, for hg.pot

Before this patch, source filename for msgid in hg.pot file becomes
incorrect, if a function is defined in file A, but detected in dict in
file B,

For example, almost all debug* commands are defined in
debugcommands.py, but hggettext detects them in "table" of
commands.py. Therefore, docstring fragments of debug* commands are
marked as "defined in commands.py" in hg.pot file.

This is serious problem for translation, because the cost to find out
original location of texts increases very much.

diff --git a/i18n/hggettext b/i18n/hggettext
--- a/i18n/hggettext
+++ b/i18n/hggettext
@@ -112,14 +112,20 @@ def docstrings(path):
 
 for func, rstrip in functions:
 if func.__doc__:
+funcmod = inspect.getmodule(func)
+extra = ''
+if funcmod.__package__ == funcmod.__name__:
+extra = '/__init__'
+actualpath = '%s%s.py' % (funcmod.__name__.replace('.', '/'), 
extra)
+
 src = inspect.getsource(func)
-name = "%s.%s" % (path, func.__name__)
+name = "%s.%s" % (actualpath, func.__name__)
 lineno = inspect.getsourcelines(func)[1]
 doc = func.__doc__
 if rstrip:
 doc = doc.rstrip()
 lineno += offset(src, doc, name, 1)
-print(poentry(path, lineno, doc))
+print(poentry(actualpath, lineno, doc))
 
 
 def rawtext(path):
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@33614: 4 new changesets (4 on stable)

2017-08-02 Thread Mercurial Commits
4 new changesets (4 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/a2b55ee62803
changeset:   33611:a2b55ee62803
branch:  stable
parent:  33609:a72b2db1a6a9
user:FUJIWARA Katsunori 
date:Mon Jul 31 13:10:19 2017 +0900
summary: tests: make pdiff return appropriate exit code at comparison of 
files

https://www.mercurial-scm.org/repo/hg/rev/798f7beadbc9
changeset:   33612:798f7beadbc9
branch:  stable
user:FUJIWARA Katsunori 
date:Mon Jul 31 13:16:34 2017 +0900
summary: tests: use pdiff instead of diff for portability

https://www.mercurial-scm.org/repo/hg/rev/3b77d4787c18
changeset:   33613:3b77d4787c18
branch:  stable
user:FUJIWARA Katsunori 
date:Tue Aug 01 01:27:32 2017 +0900
summary: tests: avoid unexpected result at invocation of *.py file on 
Windows

https://www.mercurial-scm.org/repo/hg/rev/41081364addb
changeset:   33614:41081364addb
branch:  stable
tag: tip
user:Martin von Zweigbergk 
date:Mon Jul 31 16:40:31 2017 -0700
summary: tests: clarify that duplicate flag processors is not an error

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 3 of 5 STABLE pypy] tests: clear __pycache__ for PyPy compatibility (issue5638) (issue5642)

2017-08-02 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1501679042 -32400
#  Wed Aug 02 22:04:02 2017 +0900
# Branch stable
# Node ID 0c342a3b5857d30c71d31e1933bcd2e4ea84be8f
# Parent  50ed00ce37627070546e40305460ec378bb121fb
tests: clear __pycache__ for PyPy compatibility (issue5638) (issue5642)

diff --git a/tests/test-extension.t b/tests/test-extension.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -245,6 +245,7 @@ Check absolute/relative import of extens
 
 #if no-py3k
   $ rm "$TESTTMP"/extroot/foo.*
+  $ rm -Rf "$TESTTMP/extroot/__pycache__"
   $ cat > $TESTTMP/extroot/foo.py < # test relative import
   > buf = []
@@ -1238,6 +1239,7 @@ empty declaration of supported version, 
 If the extension specifies a buglink, show that:
   $ echo 'buglink = "http://example.com/bts";' >> throw.py
   $ rm -f throw.pyc throw.pyo
+  $ rm -Rf __pycache__
   $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
   ** Unknown exception encountered with possibly-broken third-party extension 
throw
   ** which supports versions unknown of Mercurial.
@@ -1253,6 +1255,7 @@ If the extensions declare outdated versi
   $ echo "testedwith = '1.9.3'" >> older.py
   $ echo "testedwith = '2.1.1'" >> throw.py
   $ rm -f throw.pyc throw.pyo
+  $ rm -Rf __pycache__
   $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
   >   throw 2>&1 | egrep '^\*\*'
   ** Unknown exception encountered with possibly-broken third-party extension 
older
@@ -1266,6 +1269,7 @@ If the extensions declare outdated versi
 One extension only tested with older, one only with newer versions:
   $ echo "util.version = lambda:'2.1'" >> older.py
   $ rm -f older.pyc older.pyo
+  $ rm -Rf __pycache__
   $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
   >   throw 2>&1 | egrep '^\*\*'
   ** Unknown exception encountered with possibly-broken third-party extension 
older
@@ -1279,6 +1283,7 @@ One extension only tested with older, on
 Older extension is tested with current version, the other only with newer:
   $ echo "util.version = lambda:'1.9.3'" >> older.py
   $ rm -f older.pyc older.pyo
+  $ rm -Rf __pycache__
   $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
   >   throw 2>&1 | egrep '^\*\*'
   ** Unknown exception encountered with possibly-broken third-party extension 
throw
@@ -1305,6 +1310,7 @@ Declare the version as supporting this h
   >   echo "unable to fetch a mercurial version. Make sure __version__ is 
correct";
   > fi
   $ rm -f throw.pyc throw.pyo
+  $ rm -Rf __pycache__
   $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
   ** unknown exception encountered, please report by visiting
   ** https://mercurial-scm.org/wiki/BugTracker
@@ -1316,6 +1322,7 @@ Patch version is ignored during compatib
   $ echo "testedwith = '3.2'" >> throw.py
   $ echo "util.version = lambda:'3.2.2'" >> throw.py
   $ rm -f throw.pyc throw.pyo
+  $ rm -Rf __pycache__
   $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
   ** unknown exception encountered, please report by visiting
   ** https://mercurial-scm.org/wiki/BugTracker
@@ -1326,6 +1333,7 @@ Patch version is ignored during compatib
 Test version number support in 'hg version':
   $ echo '__version__ = (1, 2, 3)' >> throw.py
   $ rm -f throw.pyc throw.pyo
+  $ rm -Rf __pycache__
   $ hg version -v
   Mercurial Distributed SCM (version *) (glob)
   (see https://mercurial-scm.org for more information)
@@ -1350,6 +1358,7 @@ Test version number support in 'hg versi
 throw  external  1.2.3
   $ echo 'getversion = lambda: "1.twentythree"' >> throw.py
   $ rm -f throw.pyc throw.pyo
+  $ rm -Rf __pycache__
   $ hg version -v --config extensions.throw=throw.py --config extensions.strip=
   Mercurial Distributed SCM (version *) (glob)
   (see https://mercurial-scm.org for more information)
diff --git a/tests/test-progress.t b/tests/test-progress.t
--- a/tests/test-progress.t
+++ b/tests/test-progress.t
@@ -312,6 +312,7 @@ of which length of byte sequence and col
 from each other.
 
   $ rm -f loop.pyc
+  $ rm -Rf __pycache__
   $ cat >> loop.py < # use non-ascii characters as loop items of progress
   > loopitems = [
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 5 of 5 STABLE pypy] util: fix sortdict.update() to call __setitem__() on PyPy (issue5639)

2017-08-02 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1501681879 -32400
#  Wed Aug 02 22:51:19 2017 +0900
# Branch stable
# Node ID b05cb26a301c4495f518f7180a69389b839a1fed
# Parent  2c94746eb01204a1c703d555f21ebec031ed74b7
util: fix sortdict.update() to call __setitem__() on PyPy (issue5639)

It appears that overriding __setitem__() doesn't work as documented on PyPy.
Let's patch it as before bd0fd3ff9916.

https://docs.python.org/2/library/collections.html#ordereddict-examples-and-recipes

The issue was ui.configitems() wasn't ordered correctly, so the pull command
was wrapped in different order.

diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -16,6 +16,7 @@ import shlex
 import sys
 
 ispy3 = (sys.version_info[0] >= 3)
+ispypy = (r'__pypy__' in sys.builtin_module_names)
 
 if not ispy3:
 import cookielib
diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -584,6 +584,14 @@ class sortdict(collections.OrderedDict):
 del self[key]
 super(sortdict, self).__setitem__(key, value)
 
+if pycompat.ispypy:
+# __setitem__() isn't called as of PyPy 5.8.0
+def update(self, src):
+if isinstance(src, dict):
+src = src.iteritems()
+for k, v in src:
+self[k] = v
+
 @contextlib.contextmanager
 def acceptintervention(tr=None):
 """A context manager that closes the transaction on InterventionRequired
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 2 of 5 STABLE pypy] test-extension: glob module name in error message for PyPy

2017-08-02 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1501679205 -32400
#  Wed Aug 02 22:06:45 2017 +0900
# Branch stable
# Node ID 50ed00ce37627070546e40305460ec378bb121fb
# Parent  4291548fe6ee8bf5249d73c1eefbb145818e1318
test-extension: glob module name in error message for PyPy

diff --git a/tests/test-extension.t b/tests/test-extension.t
--- a/tests/test-extension.t
+++ b/tests/test-extension.t
@@ -1674,7 +1674,7 @@ Make sure a broken uisetup doesn't globa
 
 Even though the extension fails during uisetup, hg is still basically usable:
   $ hg version
-  *** failed to set up extension baduisetup: No module named bdiff
+  \*\*\* failed to set up extension baduisetup: No module named 
(mercurial\.)?bdiff (re)
   Mercurial Distributed SCM (version *) (glob)
   (see https://mercurial-scm.org for more information)
   
@@ -1696,8 +1696,8 @@ Even though the extension fails during u
   mod = _hgextimport(_origimport, head, globals, locals, None, level)
 File "*/hgdemandimport/demandimportpy2.py", line *, in _hgextimport (glob)
   return importfunc(name, globals, *args, **kwargs)
-  ImportError: No module named bdiff
-  *** failed to set up extension baduisetup: No module named bdiff
+  ImportError: No module named (mercurial\.)?bdiff (re)
+  \*\*\* failed to set up extension baduisetup: No module named 
(mercurial\.)?bdiff (re)
   Mercurial Distributed SCM (version *) (glob)
   (see https://mercurial-scm.org for more information)
   
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 4 of 5 STABLE pypy] test-revlog-raw: close file handles explicitly (issue5644)

2017-08-02 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1501682318 -32400
#  Wed Aug 02 22:58:38 2017 +0900
# Branch stable
# Node ID 2c94746eb01204a1c703d555f21ebec031ed74b7
# Parent  0c342a3b5857d30c71d31e1933bcd2e4ea84be8f
test-revlog-raw: close file handles explicitly (issue5644)

diff --git a/tests/test-revlog-raw.py b/tests/test-revlog-raw.py
--- a/tests/test-revlog-raw.py
+++ b/tests/test-revlog-raw.py
@@ -144,12 +144,18 @@ def lowlevelcopy(rlog, tr, destname=b'_d
 text = None
 cachedelta = (deltaparent, rlog.revdiff(deltaparent, r))
 flags = rlog.flags(r)
-ifh = dlog.opener(dlog.indexfile, 'a+')
-dfh = None
-if not dlog._inline:
-dfh = dlog.opener(dlog.datafile, 'a+')
-dlog._addrevision(rlog.node(r), text, tr, r, p1, p2, flags, cachedelta,
-  ifh, dfh)
+ifh = dfh = None
+try:
+ifh = dlog.opener(dlog.indexfile, 'a+')
+if not dlog._inline:
+dfh = dlog.opener(dlog.datafile, 'a+')
+dlog._addrevision(rlog.node(r), text, tr, r, p1, p2, flags,
+  cachedelta, ifh, dfh)
+finally:
+if dfh is not None:
+dfh.close()
+if ifh is not None:
+ifh.close()
 return dlog
 
 # Utilities to generate revisions for testing
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 5 STABLE pypy] rebase: sort collapsed revisions in commit message (issue5643)

2017-08-02 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1501678342 -32400
#  Wed Aug 02 21:52:22 2017 +0900
# Branch stable
# Node ID 4291548fe6ee8bf5249d73c1eefbb145818e1318
# Parent  76b171209151fe41dbf8dbfec473cc533f3b40ca
rebase: sort collapsed revisions in commit message (issue5643)

This fixes the test instability.

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -472,7 +472,7 @@ class rebaseruntime(object):
 commitmsg = self.collapsemsg
 else:
 commitmsg = 'Collapsed revision'
-for rebased in self.state:
+for rebased in sorted(self.state):
 if rebased not in self.skipped and\
self.state[rebased] > nullmerge:
 commitmsg += '\n* %s' % repo[rebased].description()
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH STABLE] ui: enable pager always for explicit --pager=on (issue5580)

2017-08-02 Thread Augie Fackler
On Wed, Aug 02, 2017 at 09:51:11PM +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori 
> # Date 1501581172 -32400
> #  Tue Aug 01 18:52:52 2017 +0900
> # Branch stable
> # Node ID e9883ae6e2d70b0f78ec8c8953b47130ecba3f07
> # Parent  76b171209151fe41dbf8dbfec473cc533f3b40ca
> # Available At https://bitbucket.org/foozy/mercurial-wip
> #  hg pull https://bitbucket.org/foozy/mercurial-wip -r 
> e9883ae6e2d7
> # EXP-Topic issue5580
> ui: enable pager always for explicit --pager=on (issue5580)

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


Re: [PATCH STABLE] i18n: use actual filename, in which function is defined, for hg.pot

2017-08-02 Thread Augie Fackler
On Wed, Aug 02, 2017 at 10:36:45PM +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori 
> # Date 1501599731 -32400
> #  Wed Aug 02 00:02:11 2017 +0900
> # Branch stable
> # Node ID b6d0bcd19b4dffb2360f909f459c27104ad16565
> # Parent  76b171209151fe41dbf8dbfec473cc533f3b40ca
> # Available At https://bitbucket.org/foozy/mercurial-wip
> #  hg pull https://bitbucket.org/foozy/mercurial-wip -r 
> b6d0bcd19b4d
> # EXP-Topic i18n-fix-update-pot-issues
> i18n: use actual filename, in which function is defined, for hg.pot

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


[PATCH hglib] summary: parse commit line less strictly (issue5637)

2017-08-02 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1501684996 -32400
#  Wed Aug 02 23:43:16 2017 +0900
# Node ID 5f3e6f1a7e68298e21f893683c5b5d3f634c2c30
# Parent  8e959ad6a25c9fe6ab490e1a4cbd5f7445d9bcb1
summary: parse commit line less strictly (issue5637)

diff --git a/hglib/client.py b/hglib/client.py
--- a/hglib/client.py
+++ b/hglib/client.py
@@ -1597,7 +1597,7 @@ class hgclient(object):
 elif name == b('branch'):
 pass
 elif name == b('commit'):
-value = value == b('(clean)')
+value = b('(clean)') in value
 elif name == b('update'):
 if value == b('(current)'):
 value = 0
diff --git a/tests/test-summary.py b/tests/test-summary.py
--- a/tests/test-summary.py
+++ b/tests/test-summary.py
@@ -1,3 +1,4 @@
+import unittest
 from tests import common
 import hglib
 from hglib.util import b
@@ -38,6 +39,15 @@ class test_summary(common.basetest):
 
 self.assertEquals(self.client.summary(), d)
 
+def test_secret_commit_clean(self):
+if self.client.version < (2, 1):
+raise unittest.SkipTest('phase not supported')
+self.append('a', 'a')
+rev, node = self.client.commit(b('first'), addremove=True)
+self.client.phase([b('%d') % rev], secret=True, force=True)
+e = self.client.summary()
+self.assertTrue(e[b('commit')])
+
 def test_update(self):
 self.append('a', 'a')
 rev, node = self.client.commit(b('first'), addremove=True)
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 5 of 5 STABLE pypy] util: fix sortdict.update() to call __setitem__() on PyPy (issue5639)

2017-08-02 Thread Augie Fackler
On Wed, Aug 02, 2017 at 11:22:25PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1501681879 -32400
> #  Wed Aug 02 22:51:19 2017 +0900
> # Branch stable
> # Node ID b05cb26a301c4495f518f7180a69389b839a1fed
> # Parent  2c94746eb01204a1c703d555f21ebec031ed74b7
> util: fix sortdict.update() to call __setitem__() on PyPy (issue5639)

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


D210: pushvars: move fb extension pushvars to core

2017-08-02 Thread durin42 (Augie Fackler)
durin42 added a comment.


  I've often wanted a way to have extra arguments to push commands (etc), but 
I'm not sure that just exporting all environment variables is exactly the 
interface I want. Could we accomplish something similar by having an 
--extra-args= flag that delivers a part with an arbitrary payload that can then 
be used (or not) by hooks as they see fit? Or is that too challenging?
  
  (The environment variable model also feels like it fits poorly with http 
servers, in my brain.)

REPOSITORY
  rHG Mercurial

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

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


mercurial@33618: 4 new changesets (4 on stable)

2017-08-02 Thread Mercurial Commits
4 new changesets (4 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/c6146dd10072
changeset:   33615:c6146dd10072
branch:  stable
user:Martin von Zweigbergk 
date:Mon Jul 31 16:32:01 2017 -0700
summary: tests: fix test-flagprocessor.t flakiness

https://www.mercurial-scm.org/repo/hg/rev/d84da82764e3
changeset:   33616:d84da82764e3
branch:  stable
user:Martin von Zweigbergk 
date:Mon Jul 31 14:54:08 2017 -0700
summary: tests: demonstrate that failed "hg ci -A" updates dirstate 
(issue5645)

https://www.mercurial-scm.org/repo/hg/rev/5ac845ca059a
changeset:   33617:5ac845ca059a
branch:  stable
user:Martin von Zweigbergk 
date:Mon Jul 31 14:54:57 2017 -0700
summary: commit: don't let failed commit with --addremove update dirstate 
(issue5645)

https://www.mercurial-scm.org/repo/hg/rev/76b171209151
changeset:   33618:76b171209151
branch:  stable
tag: tip
user:FUJIWARA Katsunori 
date:Mon Jul 31 21:47:53 2017 +0900
summary: README: make paragraphs before example code end with "::" for reST 
syntax

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D216: evolution: rename bumped to phase-divergent

2017-08-02 Thread durin42 (Augie Fackler)
durin42 added a comment.


  I'd like to hear others chime in on this and 
https://phab.mercurial-scm.org/D215. Do we /know/ that something that's 
phase-divergent is only divergent by phase? or could the content also be 
different? Is it possible to have a case in the tests that's both 
content-divergent and phase-divergent?

REPOSITORY
  rHG Mercurial

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

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


D208: bundle2: add the capability to store hookargs on bundle operation object

2017-08-02 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf3407d56a6e8: bundle2: add the capability to store hookargs 
on bundle operation object (authored by pulkit).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D208?vs=491&id=502

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

AFFECTED FILES
  mercurial/bundle2.py

CHANGE DETAILS

diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -299,6 +299,10 @@
 self.gettransaction = transactiongetter
 self.reply = None
 self.captureoutput = captureoutput
+self.hookargs = {}
+
+def addhookargs(self, hookargs):
+self.hookargs.update(hookargs)
 
 class TransactionUnavailable(RuntimeError):
 pass



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


D209: bundle2: load hookargs from bundleoperation into transaction when started one

2017-08-02 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG5fc4ddfbe626: bundle2: load hookargs from bundleoperation 
into transaction when started one (authored by pulkit).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D209?vs=492&id=503

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

AFFECTED FILES
  mercurial/bundle2.py
  tests/test-acl.t

CHANGE DETAILS

diff --git a/tests/test-acl.t b/tests/test-acl.t
--- a/tests/test-acl.t
+++ b/tests/test-acl.t
@@ -120,7 +120,7 @@
   bundle2-output-bundle: "HG20", 2 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: no-transaction
+  bundle2-input-bundle: with-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-bundle: 1 parts total
@@ -184,7 +184,7 @@
   bundle2-output-bundle: "HG20", 2 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: no-transaction
+  bundle2-input-bundle: with-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-bundle: 1 parts total
@@ -259,7 +259,7 @@
   bundle2-output-bundle: "HG20", 2 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: no-transaction
+  bundle2-input-bundle: with-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-bundle: 1 parts total
@@ -742,7 +742,7 @@
   bundle2-output-bundle: "HG20", 2 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: no-transaction
+  bundle2-input-bundle: with-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-bundle: 1 parts total
@@ -1056,7 +1056,7 @@
   bundle2-output-bundle: "HG20", 2 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: no-transaction
+  bundle2-input-bundle: with-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-bundle: 1 parts total
@@ -1141,7 +1141,7 @@
   bundle2-output-bundle: "HG20", 2 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: no-transaction
+  bundle2-input-bundle: with-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-bundle: 1 parts total
@@ -1298,7 +1298,7 @@
   bundle2-output-bundle: "HG20", 2 parts total
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: no-transaction
+  bundle2-input-bundle: with-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-bundle: 1 parts total
@@ -1502,7 +1502,7 @@
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: no-transaction
+  bundle2-input-bundle: with-transaction
   bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) 
supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
   bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
@@ -1798,7 +1798,7 @@
   bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) 
empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
   bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-input-bundle: no-transaction
+

D213: evolution: rename trouble(s) to instability

2017-08-02 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6f4bc9688ca9: evolution: rename trouble(s) to instability 
(authored by lothiraldan).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D213?vs=496&id=504

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

AFFECTED FILES
  mercurial/cmdutil.py
  tests/test-commit-amend.t
  tests/test-obsmarker-template.t

CHANGE DETAILS

diff --git a/tests/test-obsmarker-template.t b/tests/test-obsmarker-template.t
--- a/tests/test-obsmarker-template.t
+++ b/tests/test-obsmarker-template.t
@@ -442,14 +442,14 @@
   |  parent:  0:ea207398892e
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
-  |  trouble: divergent
+  |  instability: divergent
   |  summary: A2
   |
   | o  changeset:   2:fdf9bde5129a
   |/   parent:  0:ea207398892e
   |user:test
   |date:Thu Jan 01 00:00:00 1970 +
-  |trouble: divergent
+  |instability: divergent
   |summary: A1
   |
   | x  changeset:   1:471f378eab4c
@@ -469,7 +469,7 @@
   |  parent:  0:ea207398892e
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
-  |  trouble: divergent
+  |  instability: divergent
   |  summary: A3
   |
   | x  changeset:   3:65b757b745b9
@@ -482,7 +482,7 @@
   |/   parent:  0:ea207398892e
   |user:test
   |date:Thu Jan 01 00:00:00 1970 +
-  |trouble: divergent
+  |instability: divergent
   |summary: A1
   |
   | x  changeset:   1:471f378eab4c
@@ -1086,20 +1086,20 @@
   |  parent:  5:dd800401bd8c
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
-  |  trouble: divergent
+  |  instability: divergent
   |  summary: Add B only
   |
   | o  changeset:   8:b18bc8331526
   |/   parent:  5:dd800401bd8c
   |user:test
   |date:Thu Jan 01 00:00:00 1970 +
-  |trouble: divergent
+  |instability: divergent
   |summary: Add only B
   |
   | o  changeset:   7:ba2ed02b0c9a
   | |  user:test
   | |  date:Thu Jan 01 00:00:00 1970 +
-  | |  trouble: unstable, divergent
+  | |  instability: unstable, divergent
   | |  summary: Add A,B,C
   | |
   | x  changeset:   6:4a004186e638
@@ -,7 +,7 @@
   |  parent:  3:f897c6137566
   |  user:test
   |  date:Thu Jan 01 00:00:00 1970 +
-  |  trouble: divergent
+  |  instability: divergent
   |  summary: Add A,B,C
   |
   o  changeset:   3:f897c6137566
diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t
--- a/tests/test-commit-amend.t
+++ b/tests/test-commit-amend.t
@@ -610,7 +610,7 @@
   parent:  11:3334b7925910
   user:test
   date:Thu Jan 01 00:00:00 1970 +
-  trouble: unstable
+  instability: unstable
   summary: babar
   
 
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1579,7 +1579,7 @@
 
 if ctx.troubled():
 # i18n: column positioning for "hg log"
-self.ui.write(_("trouble: %s\n") % ', '.join(ctx.troubles()),
+self.ui.write(_("instability: %s\n") % ', '.join(ctx.troubles()),
   label='log.trouble')
 
 self._exthook(ctx)



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


D214: evolution: rename unstable to orphan

2017-08-02 Thread lothiraldan (Boris Feld)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG03039ff3082b: evolution: rename unstable to orphan 
(authored by lothiraldan).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D214?vs=497&id=505

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

AFFECTED FILES
  mercurial/commands.py
  mercurial/context.py
  mercurial/exchange.py
  tests/test-commit-amend.t
  tests/test-obsmarker-template.t
  tests/test-obsolete.t
  tests/test-rebase-obsolete.t

CHANGE DETAILS

diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -793,13 +793,13 @@
   o  0:4a2df7238c3b A
   
   $ hg summary
-  parent: 15:73568ab6879d tip (unstable)
+  parent: 15:73568ab6879d tip (orphan)
bar foo
   branch: default
   commit: (clean)
   update: 2 new changesets, 3 branch heads (merge)
   phases: 8 draft
-  unstable: 1 changesets
+  orphan: 1 changesets
   $ hg rebase -s 10 -d 12
   abort: this rebase will cause divergences from: 121d9e3bc4c6
   (to force the rebase please set experimental.allowdivergence=True)
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -520,15 +520,15 @@
   $ hg log -r 'obsolete()'
   4:94b33453f93b (draft *obsolete*) [ ] add original_d
   $ hg summary
-  parent: 5:cda648ca50f5 tip (unstable)
+  parent: 5:cda648ca50f5 tip (orphan)
add original_e
   branch: default
   commit: (clean)
   update: 1 new changesets, 2 branch heads (merge)
   phases: 3 draft
-  unstable: 1 changesets
+  orphan: 1 changesets
   $ hg log -G -r '::unstable()'
-  @  5:cda648ca50f5 (draft unstable) [tip ] add original_e
+  @  5:cda648ca50f5 (draft orphan) [tip ] add original_e
   |
   x  4:94b33453f93b (draft *obsolete*) [ ] add original_d
   |
@@ -552,7 +552,7 @@
   $ hg push ../tmpc/
   pushing to ../tmpc/
   searching for changes
-  abort: push includes unstable changeset: cda648ca50f5!
+  abort: push includes orphan changeset: cda648ca50f5!
   [255]
 
 Test that extinct changeset are properly detected
@@ -570,7 +570,7 @@
   2:245bde4270cd (public) [ ] add original_c
   3:6f9641995072 (draft) [ ] add n3w_3_c
   4:94b33453f93b (draft *obsolete*) [ ] add original_d
-  5:cda648ca50f5 (draft unstable) [tip ] add original_e
+  5:cda648ca50f5 (draft orphan) [tip ] add original_e
   $ hg push ../tmpf -f # -f because be push unstable too
   pushing to ../tmpf
   searching for changes
@@ -591,7 +591,7 @@
 Do not warn about new head when the new head is a successors of a remote one
 
   $ hg log -G
-  @  5:cda648ca50f5 (draft unstable) [tip ] add original_e
+  @  5:cda648ca50f5 (draft orphan) [tip ] add original_e
   |
   x  4:94b33453f93b (draft *obsolete*) [ ] add original_d
   |
@@ -914,7 +914,7 @@
   changeset:   7:50c51b361e60
   user:test
   date:Thu Jan 01 00:00:00 1970 +
-  trouble: unstable, bumped
+  instability: orphan, bumped
   summary: add babar
   
 
@@ -926,15 +926,15 @@
 test the "troubles" templatekw
 
   $ hg log -r 'bumped() and unstable()'
-  7:50c51b361e60 (draft unstable bumped) [ ] add babar
+  7:50c51b361e60 (draft orphan bumped) [ ] add babar
 
 test the default cmdline template
 
   $ hg log -T default -r 'bumped()'
   changeset:   7:50c51b361e60
   user:test
   date:Thu Jan 01 00:00:00 1970 +
-  trouble: unstable, bumped
+  trouble: orphan, bumped
   summary: add babar
   
   $ hg log -T default -r 'obsolete()'
@@ -950,13 +950,13 @@
   $ hg up -r 'bumped() and unstable()'
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg summary
-  parent: 7:50c51b361e60  (unstable, bumped)
+  parent: 7:50c51b361e60  (orphan, bumped)
add babar
   branch: default
   commit: (clean)
   update: 2 new changesets (update)
   phases: 4 draft
-  unstable: 2 changesets
+  orphan: 2 changesets
   bumped: 1 changesets
   $ hg up -r 'obsolete()'
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -967,7 +967,7 @@
   commit: (clean)
   update: 3 new changesets (update)
   phases: 4 draft
-  unstable: 2 changesets
+  orphan: 2 changesets
   bumped: 1 changesets
 
 Test incoming/outcoming with changesets obsoleted remotely, known locally
diff --git a/tests/test-obsmarker-template.t b/tests/test-obsmarker-template.t
--- a/tests/test-obsmarker-template.t
+++ b/tests/test-obsmarker-template.t
@@ -1099,7 +1099,7 @@
   | o  changeset:   7:ba2ed02b0c9a
   | |  user:test
   | |  date:Thu Jan 01 00:00:00 1970 +
-  | |  instability: unstable, divergent
+  | |  instability: orphan, divergent
   | |  summary: Add A,B,C
   | |
   | x  changeset:   6:4a004186e638
diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t
--- a/tests/test-commit-amend.t
+++ b/tests/test-commit-amend.t
@@ -610,7 +610,7 @@
   parent:  11:3334b7925910
   user:test
   date:   

Re: [PATCH 02 of 10 py3] hg: avoid sending unicode url into config infrastructure

2017-08-02 Thread Yuya Nishihara
On Tue, 01 Aug 2017 16:34:30 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler 
> # Date 1500906158 14400
> #  Mon Jul 24 10:22:38 2017 -0400
> # Node ID 8b22554199879f80a13ddee556bc540ddcb65a94
> # Parent  87ee5c3b3271ded54fe4462aa43a9d1520b8a10b
> hg: avoid sending unicode url into config infrastructure
> 
> This was causing some unfortunate breakage on Python 3.
> 
> diff --git a/mercurial/hg.py b/mercurial/hg.py
> --- a/mercurial/hg.py
> +++ b/mercurial/hg.py
> @@ -31,6 +31,7 @@ from . import (
>  merge as mergemod,
>  node,
>  phases,
> +pycompat,
>  repoview,
>  scmutil,
>  sshpeer,
> @@ -648,7 +649,8 @@ def clone(ui, peeropts, source, dest=Non
>  fp.write(template % defaulturl)
>  fp.close()
>  
> -destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone')
> +destrepo.ui.setconfig(
> +'paths', 'default', pycompat.bytesurl(defaulturl), 'clone')

Perhaps both template and defaulturl should be bytes. I'll send a fix.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 07 of 10 py3] bundle2: obtain repr() of exception in a python3-safe way

2017-08-02 Thread Yuya Nishihara
On Tue, 01 Aug 2017 16:34:35 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler 
> # Date 1500909551 14400
> #  Mon Jul 24 11:19:11 2017 -0400
> # Node ID 89d7a53b500a213396ab3c8e043a31dc5538ccaf
> # Parent  4c1f4e109bf90a8352a25a6b45a80fabcac6306b
> bundle2: obtain repr() of exception in a python3-safe way
> 
> This was exposed by other problems in bundle generation, but I'm not
> sure how to test it for now.
> 
> diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
> --- a/mercurial/bundle2.py
> +++ b/mercurial/bundle2.py
> @@ -1021,11 +1021,12 @@ class bundlepart(object):
>  ui.debug('bundle2-generatorexit\n')
>  raise
>  except BaseException as exc:
> +bexc = pycompat.bytestr(exc)

This can raise UnicodeEncodeError because IOError on Python 3 may contain
non-ASCII unicode strings, for example. But still it is better, so queued.

I've queued 1, 5-10 for default, thanks.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 03 of 10 py3] obsolete: use bytestr() instead of str() so the node is bytes on py3

2017-08-02 Thread Yuya Nishihara
On Tue, 01 Aug 2017 16:34:31 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler 
> # Date 1500907059 14400
> #  Mon Jul 24 10:37:39 2017 -0400
> # Node ID f50da59f7977c7d796850b95ac7c80a4fd92bd18
> # Parent  8b22554199879f80a13ddee556bc540ddcb65a94
> obsolete: use bytestr() instead of str() so the node is bytes on py3
> 
> I'm not sure this is right, since this should either be bytes or str
> to match what's going on in the revlog layer.

Sounds like a bug of revlog. 'prec' should be a binary node id, which can't
be a unicode string.

> -marker = (str(prec), tuple(succs), int(flag), metadata, date, 
> parents)
> +prec = bytes(pycompat.bytestr(prec))
> +marker = (prec, tuple(succs), int(flag), metadata, date, parents)
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 04 of 10 py3] bundle2: correct %s to %d since part ids are integers

2017-08-02 Thread Yuya Nishihara
On Tue, 01 Aug 2017 16:34:32 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler 
> # Date 1500909392 14400
> #  Mon Jul 24 11:16:32 2017 -0400
> # Node ID 73208fb1aea975f0d50168860d5bd691cbbad7e7
> # Parent  f50da59f7977c7d796850b95ac7c80a4fd92bd18
> bundle2: correct %s to %d since part ids are integers
> 
> Fixes some Python 3 regressions.
> 
> diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
> --- a/mercurial/bundle2.py
> +++ b/mercurial/bundle2.py
> @@ -976,7 +976,7 @@ class bundlepart(object):
>  parttype = self.type.upper()
>  else:
>  parttype = self.type.lower()
> -outdebug(ui, 'part %s: "%s"' % (self.id, parttype))
> +outdebug(ui, 'part %d: "%s"' % (self.id, parttype))
>  ## parttype
>  header = [_pack(_fparttypesize, len(parttype)),
>parttype, _pack(_fpartid, self.id),
> @@ -1213,7 +1213,7 @@ class unbundlepart(unpackermixin):
>  self.type = self._fromheader(typesize)
>  indebug(self.ui, 'part type: "%s"' % self.type)
>  self.id = self._unpackheader(_fpartid)[0]
> -indebug(self.ui, 'part id: "%s"' % self.id)
> +indebug(self.ui, 'part id: "%d"' % self.id)

self.id is initialized to None. I'm not pretty sure self.id has an integer
value here. Maybe it's better to use bytestr() instead.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH 03 of 10 py3] obsolete: use bytestr() instead of str() so the node is bytes on py3

2017-08-02 Thread Augie Fackler

> On Aug 2, 2017, at 11:11, Yuya Nishihara  wrote:
> 
> On Tue, 01 Aug 2017 16:34:31 -0400, Augie Fackler wrote:
>> # HG changeset patch
>> # User Augie Fackler 
>> # Date 1500907059 14400
>> #  Mon Jul 24 10:37:39 2017 -0400
>> # Node ID f50da59f7977c7d796850b95ac7c80a4fd92bd18
>> # Parent  8b22554199879f80a13ddee556bc540ddcb65a94
>> obsolete: use bytestr() instead of str() so the node is bytes on py3
>> 
>> I'm not sure this is right, since this should either be bytes or str
>> to match what's going on in the revlog layer.
> 
> Sounds like a bug of revlog. 'prec' should be a binary node id, which can't
> be a unicode string.

I think in some cases prec coming in as something that __str__ or __repr__s 
down to a valid node id, which is why the str() is here. It definitely breaks 
if you just remove the str().

> 
>> -marker = (str(prec), tuple(succs), int(flag), metadata, date, 
>> parents)
>> +prec = bytes(pycompat.bytestr(prec))
>> +marker = (prec, tuple(succs), int(flag), metadata, date, parents)

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


Re: [PATCH 03 of 10 py3] obsolete: use bytestr() instead of str() so the node is bytes on py3

2017-08-02 Thread Yuya Nishihara
On Wed, 2 Aug 2017 11:37:45 -0400, Augie Fackler wrote:
> 
> > On Aug 2, 2017, at 11:11, Yuya Nishihara  wrote:
> > 
> > On Tue, 01 Aug 2017 16:34:31 -0400, Augie Fackler wrote:
> >> # HG changeset patch
> >> # User Augie Fackler 
> >> # Date 1500907059 14400
> >> #  Mon Jul 24 10:37:39 2017 -0400
> >> # Node ID f50da59f7977c7d796850b95ac7c80a4fd92bd18
> >> # Parent  8b22554199879f80a13ddee556bc540ddcb65a94
> >> obsolete: use bytestr() instead of str() so the node is bytes on py3
> >> 
> >> I'm not sure this is right, since this should either be bytes or str
> >> to match what's going on in the revlog layer.
> > 
> > Sounds like a bug of revlog. 'prec' should be a binary node id, which can't
> > be a unicode string.
> 
> I think in some cases prec coming in as something that __str__ or __repr__s 
> down to a valid node id, which is why the str() is here. It definitely breaks 
> if you just remove the str().

Ah, got it. Perhaps it's a changectx. In which case, I think bytes() should
work. If prec doesn't implement __bytes__(), it's probably wrong.

> >> -marker = (str(prec), tuple(succs), int(flag), metadata, date, 
> >> parents)
> >> +prec = bytes(pycompat.bytestr(prec))
> >> +marker = (prec, tuple(succs), int(flag), metadata, date, parents)
> 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D216: evolution: rename bumped to phase-divergent

2017-08-02 Thread quark (Jun Wu)
quark added a comment.


  In https://phab.mercurial-scm.org/D216#3478, @durin42 wrote:
  
  > I'd like to hear others chime in on this and 
https://phab.mercurial-scm.org/D215. Do we /know/ that something that's 
phase-divergent is only divergent by phase? or could the content also be 
different? Is it possible to have a case in the tests that's both 
content-divergent and phase-divergent?
  
  
  Good question. I think conceptually phase-divergent could also be seen as 
content-divergent. I guess most users use source control without even being 
aware of the "phase" concept so it might be nice to hide that word from UI.
  
  Maybe we can merge those two into `divergent()` to simplify the concept a 
user may face. If something has to distinguish between those details, we can 
add keyword arguments to the `divergent()` revset. But I'd prefer the default 
user-facing words to just be `divergent`. Or we can think about alternative 
ways to display instability in the default log template.

REPOSITORY
  rHG Mercurial

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

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


[PATCH] py3: use bytes IO to write sample hgrc

2017-08-02 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1501688702 -32400
#  Thu Aug 03 00:45:02 2017 +0900
# Node ID 52bbc0a0dc7a3e946ed16bf547929252e95603d4
# Parent  6a620fd39e4cac88e1a46f18aa7b852639e3b729
py3: use bytes IO to write sample hgrc

Unicode sucks. Stop using Text IO and manually convert line endings.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1644,8 +1644,8 @@ def config(ui, repo, *values, **opts):
 samplehgrc = uimod.samplehgrcs['user']
 
 f = paths[0]
-fp = open(f, "w")
-fp.write(samplehgrc)
+fp = open(f, "wb")
+fp.write(util.tonativeeol(samplehgrc))
 fp.close()
 
 editor = ui.geteditor()
diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -641,11 +641,11 @@ def clone(ui, peeropts, source, dest=Non
 destrepo = destpeer.local()
 if destrepo:
 template = uimod.samplehgrcs['cloned']
-fp = destrepo.vfs("hgrc", "w", text=True)
+fp = destrepo.vfs("hgrc", "wb")
 u = util.url(abspath)
 u.passwd = None
-defaulturl = str(u)
-fp.write(template % defaulturl)
+defaulturl = bytes(u)
+fp.write(util.tonativeeol(template % defaulturl))
 fp.close()
 
 destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone')
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -60,7 +60,7 @@ git = 1
 
 samplehgrcs = {
 'user':
-"""# example user config (see 'hg help config' for more info)
+b"""# example user config (see 'hg help config' for more info)
 [ui]
 # name and email, e.g.
 # username = Jane Doe 
@@ -82,7 +82,7 @@ username =
 """,
 
 'cloned':
-"""# example repository config (see 'hg help config' for more info)
+b"""# example repository config (see 'hg help config' for more info)
 [paths]
 default = %s
 
@@ -99,7 +99,7 @@ default = %s
 """,
 
 'local':
-"""# example repository config (see 'hg help config' for more info)
+b"""# example repository config (see 'hg help config' for more info)
 [paths]
 # path aliases to other clones of this repo in URLs or filesystem paths
 # (see 'hg help config.paths' for more info)
@@ -115,7 +115,7 @@ default = %s
 """,
 
 'global':
-"""# example system-wide hg config (see 'hg help config' for more info)
+b"""# example system-wide hg config (see 'hg help config' for more info)
 
 [ui]
 # uncomment to disable color in command output
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


mercurial@33619: new changeset

2017-08-02 Thread Mercurial Commits
New changeset in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/609606d21765
changeset:   33619:609606d21765
bookmark:@
tag: tip
parent:  33610:658524d45af0
user:Durham Goode 
date:Thu Jul 20 01:30:41 2017 -0700
summary: rebase: use one dirstateguard for when using 
rebase.singletransaction

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D216: evolution: rename bumped to phase-divergent

2017-08-02 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D216#3478, @durin42 wrote:
  
  > I'd like to hear others chime in on this and 
https://phab.mercurial-scm.org/D215. Do we /know/ that something that's 
phase-divergent is only divergent by phase? or could the content also be 
different? Is it possible to have a case in the tests that's both 
content-divergent and phase-divergent?
  
  
  I know I'm really late to the party and sorry about that, but...
  
  How about instead of "phase-divergent" calling it "overdue"? That seems to 
capture it pretty well to me -- the only problem with the commit was that it 
arrived too late. "Tardy" might also be good, but that's probably less familiar 
to non-native speakers.

REPOSITORY
  rHG Mercurial

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

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


D210: pushvars: move fb extension pushvars to core

2017-08-02 Thread akushner (Aaron Kushner)
akushner added a comment.


  @durin42 - This isn't exporting all the shell variables it works almost 
exactly like you are suggesting
  
  > Could we accomplish something similar by having an --extra-args= flag that 
delivers a part with an arbitrary payload that can then be used (or not) by 
hooks as they see fit?
  
  How we use this feature:
  
hg push --pushvars "BYPASS_LARGE_FILE_CHECK=true"
  
  and then the hook that usually balks when someone tries to upload some 
ridiculously sized binary does something like
  
if [[ $HG_USERVAR_BYPASS_LARGE_FILE_CHECK == true ]]; then 
  # Don't bail and allow what we usually don't allow
fi
  
  Notice that the HG_USERVAR is prepended to the "BYPASS_LARGE_FILE_CHECK" var? 
The user can't override normal shell variables with this.

REPOSITORY
  rHG Mercurial

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

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


D210: pushvars: move fb extension pushvars to core

2017-08-02 Thread durin42 (Augie Fackler)
durin42 added a comment.


  In https://phab.mercurial-scm.org/D210#3506, @akushner wrote:
  
  > @durin42 - This isn't exporting all the shell variables it works almost 
exactly like you are suggesting
  >
  > > Could we accomplish something similar by having an --extra-args= flag 
that delivers a part with an arbitrary payload that can then be used (or not) 
by hooks as they see fit?
  >
  > How we use this feature:
  >
  >   hg push --pushvars "BYPASS_LARGE_FILE_CHECK=true"
  >
  >
  > and then the hook that usually balks when someone tries to upload some 
ridiculously sized binary does something like
  >
  >   if [[ $HG_USERVAR_BYPASS_LARGE_FILE_CHECK == true ]]; then 
  > # Don't bail and allow what we usually don't allow
  >   fi
  >
  
  
  Right, that's roughly what I expected. Could it be done using HG_EXTRA_ARGS 
that was set to whatever --extra-args contained?
  
  > Notice that the HG_USERVAR is prepended to the "BYPASS_LARGE_FILE_CHECK" 
var? The user can't override normal shell variables with this.
  
  Sure, but environment variables are still global state, so its got nonzero 
concurrency concerns. I'm also *extremely* uncomfortable shipping *all* 
environment variables because people put credentials in them on a regular 
basis, so if we do go with the "ship an environment variable" approach, I think 
the user should be specifying which variables to send.

REPOSITORY
  rHG Mercurial

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

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


D210: pushvars: move fb extension pushvars to core

2017-08-02 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  
  
  >> Notice that the HG_USERVAR is prepended to the "BYPASS_LARGE_FILE_CHECK" 
var? The user can't override normal shell variables with this.
  > 
  > Sure, but environment variables are still global state, so its got nonzero 
concurrency concerns. I'm also *extremely* uncomfortable shipping *all* 
environment variables because people put credentials in them on a regular 
basis, so if we do go with the "ship an environment variable" approach, I think 
the user should be specifying which variables to send.
  
  This is not sending all the environment variables of a user. Only the key, 
values passed with --pushvars are send to server and server has an option 
whether to unbundle them or not. The keys passed with --pushvars are prepended 
with HG_USERVAR. I am sorry if the commit description is confusing.

REPOSITORY
  rHG Mercurial

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

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


D216: evolution: rename bumped to phase-divergent

2017-08-02 Thread lothiraldan (Boris Feld)
lothiraldan added a comment.


  According to my understanding of `context.troubles`, a changeset could be 
both content-divergent and phase-divergent, it should be easy to add a test for 
that.
  
  About phase-divergent name, I like it, it's both explicit and coherent with 
the other terms. Maybe this discussion already happened in one medium listed 
here: https://www.mercurial-scm.org/wiki/CEDVocabulary#See_Also
  
  I think phases are more or less visible depending on your workflow, hiding it 
would not be possible for everyone I'm afraid.

REPOSITORY
  rHG Mercurial

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

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


D210: pushvars: move fb extension pushvars to core

2017-08-02 Thread akushner (Aaron Kushner)
akushner added inline comments.

INLINE COMMENTS

> commands.py:4012
> +The --pushvars option is used to passed environment variables to server. 
> If
> +you want to disable this on your server for security purposes, you can 
> add
> +the following to your configuration file:

The --pushvars option sends strings to the server that become environment 
variables prepended with HG_USERVAR_. For example, '--pushvars 
ENABLE_FEATURE=true', provides the server side hooks with 
'HG_USERVAR_ENABLE_FEATURE=true' as part of their environment.
  
  Pushvars can provide for user-overridable hooks as well as set debug levels. 
One example is having a hook that blocks commits containing conflict markers, 
but enables the user to override the hook if the file is using conflict markers 
for testing purposes or the file format has strings that look like conflict 
markers.
  
  To enable this feature on your server, add the following to your 
configuration file:
  
  [push]
  pushvars.server = true

REPOSITORY
  rHG Mercurial

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

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


D210: pushvars: move fb extension pushvars to core

2017-08-02 Thread quark (Jun Wu)
quark added inline comments.

INLINE COMMENTS

> commands.py:3973
>  ('', 'new-branch', False, _('allow pushing a new branch')),
> +('', 'pushvars', [], _('variables that can be sent to server')),
>  ] + remoteopts,

Maybe add `(ADVANCED)` so it gets hidden in `--help` without `--verbose`.

> akushner wrote in commands.py:4012
>   The --pushvars option sends strings to the server that become environment 
> variables prepended with HG_USERVAR_. For example, '--pushvars 
> ENABLE_FEATURE=true', provides the server side hooks with 
> 'HG_USERVAR_ENABLE_FEATURE=true' as part of their environment.
>   
>   Pushvars can provide for user-overridable hooks as well as set debug 
> levels. One example is having a hook that blocks commits containing conflict 
> markers, but enables the user to override the hook if the file is using 
> conflict markers for testing purposes or the file format has strings that 
> look like conflict markers.
>   
>   To enable this feature on your server, add the following to your 
> configuration file:
>   
>   [push]
>   pushvars.server = true

To better fit the rst format, it might be:

  .. container:: verbose
  
 The --pushvars option sends strings to the server that become environment
 variables prepended with HG_USERVAR_. For example, ``--pushvars
 ENABLE_FEATURE=true`` provides the server side hooks with
 ``HG_USERVAR_ENABLE_FEATURE=true`` as part of their environment.
  
 Pushvars can provide for user-overridable hooks as well as set debug 
levels.
 One example is having a hook that blocks commits containing conflict
 markers, but enables the user to override the hook if the file is using
 conflict markers for testing purposes or the file format has strings that
 look like conflict markers.
  
 By default, servers will ignore `--pushvars`. To enable it, set
 ``pushvars.server`` set to ``true`` server-side.

REPOSITORY
  rHG Mercurial

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

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


D211: tests: demonstrate broken rebase of merge with p1's successor in dest

2017-08-02 Thread quark (Jun Wu)
quark accepted this revision.
quark added a comment.


  Looks great! Thanks for finding and documenting these tricky cases!
  
  There are a few places that might miss some English words. Those could 
probably be fixed in flight.

INLINE COMMENTS

> test-rebase-obsolete.t:960
> +
> +Rebase merge with successor of one parent ancestor of destination
> +

`s/parent ancestor/parent being ancestor/g` ?

REPOSITORY
  rHG Mercurial

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

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


D212: tests: demonstrate crash when trying to rebase merge without its parents

2017-08-02 Thread quark (Jun Wu)
quark accepted this revision.
quark added a comment.


  Thanks for this case too!

REPOSITORY
  rHG Mercurial

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

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


D211: tests: demonstrate broken rebase of merge with p1's successor in dest

2017-08-02 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 506.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D211?vs=494&id=506

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

AFFECTED FILES
  tests/test-rebase-obsolete.t

CHANGE DETAILS

diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -13,6 +13,7 @@
   > publish=False
   > [extensions]
   > rebase=
+  > drawdag=$TESTDIR/drawdag.py
   > EOF
 
 Setup rebase canonical repo
@@ -896,55 +897,202 @@
   rebasing 22:7bdc8a87673d "dummy change" (tip)
   $ cd ..
 
-rebase source is obsoleted (issue5198)
--
+Rebase merge where successor of one parent is equal to destination (issue5198)
+
+  $ hg init p1-succ-is-dest
+  $ cd p1-succ-is-dest
 
-  $ hg clone base amended
-  updating to branch default
-  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ cd amended
-  $ hg up 9520eea781bc
-  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-  $ echo 1 >> E
-  $ hg commit --amend -m "E'" -d "0 0"
+  $ hg debugdrawdag <   F
+  >  /|
+  > E D B # replace: D -> B
+  >  \|/
+  >   A
+  > EOF
+
+  $ hg rebase -d B -s D
+  note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 
1:112478962961 "B"
+  rebasing 4:66f1a38021c9 "F" (F tip)
   $ hg log -G
-  @  9:69abe8906104 E'
-  |
-  | o  7:02de42196ebe H
-  | |
-  | | o  6:eea13746799a G
+  o5:50e9d60b99c6 F
+  |\
+  | | x  4:66f1a38021c9 F
   | |/|
-  | o |  5:24b6387c8c8c F
-  |/ /
-  | x  4:9520eea781bc E
+  | o |  3:7fb047a69f22 E
+  | | |
+  | | x  2:b18e25de2cf5 D
+  | |/
+  o |  1:112478962961 B
   |/
-  | o  3:32af7686d403 D
+  o  0:426bada5c675 A
+  
+  $ cd ..
+
+Rebase merge where successor of other parent is equal to destination
+
+  $ hg init p2-succ-is-dest
+  $ cd p2-succ-is-dest
+
+  $ hg debugdrawdag <   F
+  >  /|
+  > E D B # replace: E -> B
+  >  \|/
+  >   A
+  > EOF
+
+BROKEN: Raises an exception
+  $ hg rebase -d B -s E 2>&1 | grep AssertionError:
+  AssertionError: no base found to rebase on (defineparents called wrong)
+  $ hg log -G
+  o4:66f1a38021c9 F
+  |\
+  | x  3:7fb047a69f22 E
   | |
-  | o  2:5fddd98957c8 C
-  | |
-  | o  1:42ccdea3bb16 B
+  o |  2:b18e25de2cf5 D
   |/
-  o  0:cd010b8cd998 A
+  | o  1:112478962961 B
+  |/
+  o  0:426bada5c675 A
   
-  $ hg rebase -d . -s 9520eea781bc
-  note: not rebasing 4:9520eea781bc "E", already in destination as 
9:69abe8906104 "E'"
-  rebasing 6:eea13746799a "G"
+  $ cd ..
+
+Rebase merge where successor of one parent is ancestor of destination
+
+  $ hg init p1-succ-in-dest
+  $ cd p1-succ-in-dest
+
+  $ hg debugdrawdag <   F C
+  >  /| |
+  > E D B # replace: D -> B
+  >  \|/
+  >   A
+  > EOF
+
+  $ hg rebase -d C -s D
+  note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 
1:112478962961 "B"
+  rebasing 5:66f1a38021c9 "F" (F tip)
+BROKEN: not rebased on top of requested destination (C)
   $ hg log -G
-  o10:17be06e82e95 G
+  o6:50e9d60b99c6 F
+  |\
+  | | x  5:66f1a38021c9 F
+  | |/|
+  +-o  4:26805aba1e60 C
+  | | |
+  | o |  3:7fb047a69f22 E
+  | | |
+  | | x  2:b18e25de2cf5 D
+  | |/
+  o |  1:112478962961 B
+  |/
+  o  0:426bada5c675 A
+  
+  $ cd ..
+
+Rebase merge where successor of other parent is ancestor of destination
+
+  $ hg init p2-succ-in-dest
+  $ cd p2-succ-in-dest
+
+  $ hg debugdrawdag <   F C
+  >  /| |
+  > E D B # replace: E -> B
+  >  \|/
+  >   A
+  > EOF
+
+BROKEN: Raises an exception
+  $ hg rebase -d C -s E 2>&1 | grep AssertionError:
+  AssertionError: no base found to rebase on (defineparents called wrong)
+  $ hg log -G
+  o5:66f1a38021c9 F
   |\
-  | @  9:69abe8906104 E'
-  | |
-  +---o  7:02de42196ebe H
-  | |
-  o |  5:24b6387c8c8c F
+  | | o  4:26805aba1e60 C
+  | | |
+  | x |  3:7fb047a69f22 E
+  | | |
+  o | |  2:b18e25de2cf5 D
+  |/ /
+  | o  1:112478962961 B
   |/
-  | o  3:32af7686d403 D
-  | |
-  | o  2:5fddd98957c8 C
-  | |
-  | o  1:42ccdea3bb16 B
+  o  0:426bada5c675 A
+  
+  $ cd ..
+
+Rebase merge where successor of one parent is ancestor of destination
+
+  $ hg init p1-succ-in-dest-b
+  $ cd p1-succ-in-dest-b
+
+  $ hg debugdrawdag <   F C
+  >  /| |
+  > E D B # replace: E -> B
+  >  \|/
+  >   A
+  > EOF
+
+  $ hg rebase -d C -b F
+  rebasing 2:b18e25de2cf5 "D" (D)
+  note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 
1:112478962961 "B"
+  rebasing 5:66f1a38021c9 "F" (F tip)
+  $ hg log -G
+  o  7:9ed45af61fa0 F
+  |
+  o  6:8f47515dda15 D
+  |
+  | x5:66f1a38021c9 F
+  | |\
+  o | |  4:26805aba1e60 C
+  | | |
+  | | x  3:7fb047a69f22 E
+  | | |
+  | x |  2:b18e25de2cf5 D
+  | |/
+  o /  1:112478962961 B
   |/
-  o  0:cd010b8cd998 A
+  o  0:426bada5c675 A
+  
+  $ cd ..
+
+Rebase merge where successor of other parent is ancestor of destination
+
+  $ hg init p2-succ-in-dest-b
+  $ cd p2-succ-in-dest-b
+
+  $ hg debugdrawdag < 

D211: tests: demonstrate broken rebase of merge with p1's successor in dest

2017-08-02 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> quark wrote in test-rebase-obsolete.t:960
> `s/parent ancestor/parent being ancestor/g` ?

Hmm, that didn't read very well (my version of it). I rephrased it slightly 
differently.

REPOSITORY
  rHG Mercurial

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

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


D210: pushvars: move fb extension pushvars to core

2017-08-02 Thread quark (Jun Wu)
quark added inline comments.

INLINE COMMENTS

> quark wrote in commands.py:4012
> To better fit the rst format, it might be:
> 
>   .. container:: verbose
>   
>  The --pushvars option sends strings to the server that become environment
>  variables prepended with HG_USERVAR_. For example, ``--pushvars
>  ENABLE_FEATURE=true`` provides the server side hooks with
>  ``HG_USERVAR_ENABLE_FEATURE=true`` as part of their environment.
>   
>  Pushvars can provide for user-overridable hooks as well as set debug 
> levels.
>  One example is having a hook that blocks commits containing conflict
>  markers, but enables the user to override the hook if the file is using
>  conflict markers for testing purposes or the file format has strings that
>  look like conflict markers.
>   
>  By default, servers will ignore `--pushvars`. To enable it, set
>  ``pushvars.server`` set to ``true`` server-side.

Oops, `set to` should be changed to `to`.

REPOSITORY
  rHG Mercurial

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

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


D210: pushvars: move fb extension pushvars to core

2017-08-02 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 512.
pulkit edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D210?vs=493&id=512

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

AFFECTED FILES
  mercurial/bundle2.py
  mercurial/commands.py
  mercurial/exchange.py
  tests/test-completion.t
  tests/test-pushvars.t

CHANGE DETAILS

diff --git a/tests/test-pushvars.t b/tests/test-pushvars.t
new file mode 100644
--- /dev/null
+++ b/tests/test-pushvars.t
@@ -0,0 +1,71 @@
+Setup
+
+  $ PYTHONPATH=$TESTDIR/..:$PYTHONPATH
+  $ export PYTHONPATH
+
+  $ cat > $TESTTMP/pretxnchangegroup.sh << EOF
+  > #!/bin/sh
+  > env | egrep "^HG_USERVAR_(DEBUG|BYPASS_REVIEW)" | sort
+  > exit 0
+  > EOF
+  $ chmod +x $TESTTMP/pretxnchangegroup.sh
+  $ cat >> $HGRCPATH << EOF
+  > [hooks]
+  > pretxnchangegroup = $TESTTMP/pretxnchangegroup.sh
+  > [experimental]
+  > bundle2-exp = true
+  > EOF
+
+  $ hg init repo
+  $ hg clone -q repo child
+  $ cd child
+
+Test pushing vars to repo with pushvars.server not set
+
+  $ echo b > a
+  $ hg commit -Aqm a
+  $ hg push --pushvars "DEBUG=1" --pushvars "BYPASS_REVIEW=true"
+  pushing to $TESTTMP/repo (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+Setting pushvars.sever = true and then pushing.
+
+  $ echo [push] >> $HGRCPATH
+  $ echo "pushvars.server = true" >> $HGRCPATH
+  $ echo b >> a
+  $ hg commit -Aqm a
+  $ hg push --pushvars "DEBUG=1" --pushvars "BYPASS_REVIEW=true"
+  pushing to $TESTTMP/repo
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  HG_USERVAR_BYPASS_REVIEW=true
+  HG_USERVAR_DEBUG=1
+
+Test pushing var with empty right-hand side
+
+  $ echo b >> a
+  $ hg commit -Aqm a
+  $ hg push --pushvars "DEBUG="
+  pushing to $TESTTMP/repo (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  HG_USERVAR_DEBUG=
+
+Test pushing bad vars
+
+  $ echo b >> a
+  $ hg commit -Aqm b
+  $ hg push --pushvars "DEBUG"
+  pushing to $TESTTMP/repo (glob)
+  abort: unable to parse variable 'DEBUG', should follow 'KEY=VALUE' or 'KEY=' 
format
+  [255]
diff --git a/tests/test-completion.t b/tests/test-completion.t
--- a/tests/test-completion.t
+++ b/tests/test-completion.t
@@ -228,7 +228,7 @@
   log: follow, follow-first, date, copies, keyword, rev, removed, only-merges, 
user, only-branch, branch, prune, patch, git, limit, no-merges, stat, graph, 
style, template, include, exclude
   merge: force, rev, preview, tool
   pull: update, force, rev, bookmark, branch, ssh, remotecmd, insecure
-  push: force, rev, bookmark, branch, new-branch, ssh, remotecmd, insecure
+  push: force, rev, bookmark, branch, new-branch, pushvars, ssh, remotecmd, 
insecure
   remove: after, force, subrepos, include, exclude
   serve: accesslog, daemon, daemon-postexec, errorlog, port, address, prefix, 
name, web-conf, webdir-conf, pid-file, stdio, cmdserver, templates, style, 
ipv6, certificate, subrepos
   status: all, modified, added, removed, deleted, clean, unknown, ignored, 
no-status, terse, copies, print0, rev, change, include, exclude, subrepos, 
template
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -891,6 +891,14 @@
 pushop.bkresult = 1
 return handlereply
 
+@b2partsgenerator('pushvars', idx=0)
+def _getbundlesendvars(pushop, bundler):
+'''send shellvars via bundle2'''
+if getattr(pushop.repo, '_shellvars', ()):
+part = bundler.newpart('pushvars')
+
+for key, value in pushop.repo._shellvars.iteritems():
+part.addparam(key, value, mandatory=False)
 
 def _pushbundle2(pushop):
 """push data to the remote using bundle2
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3970,6 +3970,7 @@
 ('b', 'branch', [],
  _('a specific branch you would like to push'), _('BRANCH')),
 ('', 'new-branch', False, _('allow pushing a new branch')),
+('', 'pushvars', [], _('variables that can be sent to server (ADVANCED)')),
 ] + remoteopts,
 _('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]'))
 def push(ui, repo, dest=None, **opts):
@@ -4007,6 +4008,25 @@
 Please see :hg:`help urls` for important details about ``ssh://``
 URLs. If DESTINATION is omitted, a default path will be used.
 
+.. container:: verbose
+
+The --pushvars option sends strings to the server that become
+environment variables prepended with ``HG_USERVAR_``. For example,
+``--pushvars ENABLE_FEATURE=true``, provides the server side hooks with
+``HG_USERVAR_ENABLE_FEATURE=true`` as part of their environment.
+
+pushvars can provide for u

D218: phabricator: add --confirm option to phabsend command

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

REVISION SUMMARY
  This adds a --confirm flag similar to the confirm flag of `hg email` using 
which
  one can confirm the changesets before they get emailed. The confirm flag will
  show the changesets and ask for confirmation before sending them.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -313,7 +313,8 @@
 
 @command('phabsend',
  [('r', 'rev', [], _('revisions to send'), _('REV')),
-  ('', 'reviewer', [], _('specify reviewers'))],
+  ('', 'reviewer', [], _('specify reviewers')),
+  ('', 'confirm', None, _('ask for confirmation before sending'))],
  _('REV [OPTIONS]'))
 def phabsend(ui, repo, *revs, **opts):
 """upload changesets to Phabricator
@@ -333,6 +334,13 @@
 if not revs:
 raise error.Abort(_('phabsend requires at least one changeset'))
 
+confirm = ui.configbool('phabsend', 'confirm')
+confirm |= bool(opts.get('confirm'))
+if confirm:
+confirmed = _confirmbeforesend(repo, revs)
+if not confirmed:
+raise error.Abort(_('phabsend cancelled'))
+
 actions = []
 reviewers = opts.get('reviewer', [])
 if reviewers:
@@ -379,6 +387,20 @@
 _metanamemap = util.sortdict([(r'user', 'User'), (r'date', 'Date'),
   (r'node', 'Node ID'), (r'parent', 'Parent ')])
 
+def _confirmbeforesend(repo, revs):
+ui = repo.ui
+for rev in revs:
+ctx = repo[rev]
+desc = ctx.description().splitlines()[0]
+ui.write(('%d: ' % rev), label='phabsend.revnumber')
+ui.write(('%s\n' % desc), label='phabsend.desc')
+
+if ui.promptchoice(_('Phabsend the above changes (yn)?'
+'$$ &Yes $$ &No')):
+return False
+
+return True
+
 def querydrev(repo, params, stack=False):
 """return a list of "Differential Revision" dicts
 



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


[PATCH 2 of 3 sparse-ext v3] match: expose some data and functionality to other modules

2017-08-02 Thread Kostia Balytskyi
# HG changeset patch
# User Kostia Balytskyi 
# Date 1501714137 25200
#  Wed Aug 02 15:48:57 2017 -0700
# Node ID c0136292871d85675ccb9f386f4ae1913da4eb53
# Parent  d24d6711aa2a5397d52f46ccffa64c2a638c088b
match: expose some data and functionality to other modules

This patch makes sure that other modules can check whether patterns
are CWD-relative.

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -18,6 +18,11 @@ from . import (
 util,
 )
 
+allpatternkinds = ('re', 'glob', 'path', 'relglob', 'relpath', 'relre',
+   'listfile', 'listfile0', 'set', 'include', 'subinclude',
+   'rootfilesin')
+cwdrelativepatternkinds = ('relpath', 'glob')
+
 propertycache = util.propertycache
 
 def _rematcher(regex):
@@ -190,7 +195,7 @@ def _donormalize(patterns, default, root
 normalized and rooted patterns and with listfiles expanded.'''
 kindpats = []
 for kind, pat in [_patsplit(p, default) for p in patterns]:
-if kind in ('glob', 'relpath'):
+if kind in cwdrelativepatternkinds:
 pat = pathutil.canonpath(root, cwd, pat, auditor)
 elif kind in ('relglob', 'path', 'rootfilesin'):
 pat = util.normpath(pat)
@@ -691,9 +696,7 @@ def _patsplit(pattern, default):
 pattern."""
 if ':' in pattern:
 kind, pat = pattern.split(':', 1)
-if kind in ('re', 'glob', 'path', 'relglob', 'relpath', 'relre',
-'listfile', 'listfile0', 'set', 'include', 'subinclude',
-'rootfilesin'):
+if kind in allpatternkinds:
 return kind, pat
 return default, pattern
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 3 of 3 sparse-ext v3] sparse: treat paths as cwd-relative

2017-08-02 Thread Kostia Balytskyi
# HG changeset patch
# User Kostia Balytskyi 
# Date 1501715099 25200
#  Wed Aug 02 16:04:59 2017 -0700
# Node ID 871dbf4ff5dd097e3960aed0d6b67fe401552d6a
# Parent  c0136292871d85675ccb9f386f4ae1913da4eb53
sparse: treat paths as cwd-relative

This commit makes it so sparse treats passed paths as CWD-relative,
not repo-root-realive. This is a more intuitive behavior in my (and some
other FB people's) opinion.

This is breaking change however. My hope here is that since sparse is
experimental, it's ok to introduce BCs.

The reason (glob)s are needed in the test is this: in these two cases we
do not supply path together with slashes, but `os.path.join` adds them, which
means that under Windows they can be backslashes. To demonstrate this behavior,
one could remove the (glob)s and run `./run-tests.py test-sparse.t` from
MinGW's terminal on Windows.

diff --git a/hgext/sparse.py b/hgext/sparse.py
--- a/hgext/sparse.py
+++ b/hgext/sparse.py
@@ -155,7 +155,8 @@ def _clonesparsecmd(orig, ui, repo, *arg
 if include or exclude or enableprofile:
 def clonesparse(orig, self, node, overwrite, *args, **kwargs):
 sparse.updateconfig(self.unfiltered(), pat, {}, include=include,
-exclude=exclude, enableprofile=enableprofile)
+exclude=exclude, enableprofile=enableprofile,
+usereporootpaths=True)
 return orig(self, node, overwrite, *args, **kwargs)
 extensions.wrapfunction(hg, 'updaterepo', clonesparse)
 return orig(ui, repo, *args, **opts)
diff --git a/mercurial/sparse.py b/mercurial/sparse.py
--- a/mercurial/sparse.py
+++ b/mercurial/sparse.py
@@ -17,6 +17,7 @@ from . import (
 error,
 match as matchmod,
 merge as mergemod,
+pathutil,
 pycompat,
 scmutil,
 util,
@@ -616,7 +617,7 @@ def importfromfiles(repo, opts, paths, f
 
 def updateconfig(repo, pats, opts, include=False, exclude=False, reset=False,
  delete=False, enableprofile=False, disableprofile=False,
- force=False):
+ force=False, usereporootpaths=False):
 """Perform a sparse config update.
 
 Only one of the actions may be performed.
@@ -639,6 +640,18 @@ def updateconfig(repo, pats, opts, inclu
 if any(os.path.isabs(pat) for pat in pats):
 raise error.Abort(_('paths cannot be absolute'))
 
+if not usereporootpaths:
+# let's treat paths as relative to cwd
+root, cwd = repo.root, repo.getcwd()
+abspats = []
+for kindpat in pats:
+kind, pat = matchmod._patsplit(kindpat, None)
+if kind in matchmod.cwdrelativepatternkinds or kind is None:
+ap = (kind + ':' if kind else '') +\
+pathutil.canonpath(root, cwd, pat)
+abspats.append(ap)
+pats = abspats
+
 if include:
 newinclude.update(pats)
 elif exclude:
diff --git a/tests/test-sparse.t b/tests/test-sparse.t
--- a/tests/test-sparse.t
+++ b/tests/test-sparse.t
@@ -48,6 +48,29 @@ TODO: See if this can be made to fail th
   [255]
 #endif
 
+Paths should be treated as cwd-relative, not repo-root-relative
+  $ mkdir subdir && cd subdir
+  $ hg debugsparse --include path
+  $ hg debugsparse
+  [include]
+  $TESTTMP/myrepo/hide
+  hide
+  subdir/path (glob)
+  
+  $ cd ..
+  $ echo hello > subdir/file2.ext
+  $ cd subdir
+  $ hg debugsparse --include '**.ext'  # let us test globs
+  $ cd ..
+  $ hg debugsparse
+  [include]
+  $TESTTMP/myrepo/hide
+  hide
+  subdir/**.ext
+  subdir/path (glob)
+  
+  $ rm -rf subdir
+
 Verify commiting while sparse includes other files
 
   $ echo z > hide
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 1 of 3 sparse-ext v3] sparse: properly error out when absolute paths are used

2017-08-02 Thread Kostia Balytskyi
# HG changeset patch
# User Kostia Balytskyi 
# Date 1501711521 25200
#  Wed Aug 02 15:05:21 2017 -0700
# Node ID d24d6711aa2a5397d52f46ccffa64c2a638c088b
# Parent  609606d217659e0a6c1cf6f907b6512be5340e57
sparse: properly error out when absolute paths are used

Current logic is misleading (it says it drops only absolute paths, but
it actually drops all of them), not cross-platform (does not support Windows)
and IMO just wrong (as it should just error out if absolute paths are given).

This commit fixes it.

diff --git a/mercurial/sparse.py b/mercurial/sparse.py
--- a/mercurial/sparse.py
+++ b/mercurial/sparse.py
@@ -636,10 +636,10 @@ def updateconfig(repo, pats, opts, inclu
 newexclude = set(oldexclude)
 newprofiles = set(oldprofiles)
 
-if any(pat.startswith('/') for pat in pats):
-repo.ui.warn(_('warning: paths cannot start with /, ignoring: 
%s\n')
- % ([pat for pat in pats if pat.startswith('/')]))
-elif include:
+if any(os.path.isabs(pat) for pat in pats):
+raise error.Abort(_('paths cannot be absolute'))
+
+if include:
 newinclude.update(pats)
 elif exclude:
 newexclude.update(pats)
diff --git a/tests/test-sparse.t b/tests/test-sparse.t
--- a/tests/test-sparse.t
+++ b/tests/test-sparse.t
@@ -29,20 +29,22 @@ Absolute paths outside the repo should j
 
 #if no-windows
   $ hg debugsparse --include /foo/bar
-  warning: paths cannot start with /, ignoring: ['/foo/bar']
+  abort: paths cannot be absolute
+  [255]
   $ hg debugsparse --include '$TESTTMP/myrepo/hide'
 
   $ hg debugsparse --include '/root'
-  warning: paths cannot start with /, ignoring: ['/root']
+  abort: paths cannot be absolute
+  [255]
 #else
 TODO: See if this can be made to fail the same way as on Unix
   $ hg debugsparse --include /c/foo/bar
-  abort: c:/foo/bar not under root '$TESTTMP/myrepo' (glob)
+  abort: paths cannot be absolute
   [255]
   $ hg debugsparse --include '$TESTTMP/myrepo/hide'
 
   $ hg debugsparse --include '/c/root'
-  abort: c:/root not under root '$TESTTMP/myrepo' (glob)
+  abort: paths cannot be absolute
   [255]
 #endif
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D210: pushvars: move fb extension pushvars to core

2017-08-02 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 514.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D210?vs=512&id=514

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

AFFECTED FILES
  mercurial/bundle2.py
  mercurial/commands.py
  mercurial/exchange.py
  tests/test-completion.t
  tests/test-pushvars.t

CHANGE DETAILS

diff --git a/tests/test-pushvars.t b/tests/test-pushvars.t
new file mode 100644
--- /dev/null
+++ b/tests/test-pushvars.t
@@ -0,0 +1,71 @@
+Setup
+
+  $ PYTHONPATH=$TESTDIR/..:$PYTHONPATH
+  $ export PYTHONPATH
+
+  $ cat > $TESTTMP/pretxnchangegroup.sh << EOF
+  > #!/bin/sh
+  > env | egrep "^HG_USERVAR_(DEBUG|BYPASS_REVIEW)" | sort
+  > exit 0
+  > EOF
+  $ chmod +x $TESTTMP/pretxnchangegroup.sh
+  $ cat >> $HGRCPATH << EOF
+  > [hooks]
+  > pretxnchangegroup = $TESTTMP/pretxnchangegroup.sh
+  > [experimental]
+  > bundle2-exp = true
+  > EOF
+
+  $ hg init repo
+  $ hg clone -q repo child
+  $ cd child
+
+Test pushing vars to repo with pushvars.server not set
+
+  $ echo b > a
+  $ hg commit -Aqm a
+  $ hg push --pushvars "DEBUG=1" --pushvars "BYPASS_REVIEW=true"
+  pushing to $TESTTMP/repo (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+Setting pushvars.sever = true and then pushing.
+
+  $ echo [push] >> $HGRCPATH
+  $ echo "pushvars.server = true" >> $HGRCPATH
+  $ echo b >> a
+  $ hg commit -Aqm a
+  $ hg push --pushvars "DEBUG=1" --pushvars "BYPASS_REVIEW=true"
+  pushing to $TESTTMP/repo (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  HG_USERVAR_BYPASS_REVIEW=true
+  HG_USERVAR_DEBUG=1
+
+Test pushing var with empty right-hand side
+
+  $ echo b >> a
+  $ hg commit -Aqm a
+  $ hg push --pushvars "DEBUG="
+  pushing to $TESTTMP/repo (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  HG_USERVAR_DEBUG=
+
+Test pushing bad vars
+
+  $ echo b >> a
+  $ hg commit -Aqm b
+  $ hg push --pushvars "DEBUG"
+  pushing to $TESTTMP/repo (glob)
+  abort: unable to parse variable 'DEBUG', should follow 'KEY=VALUE' or 'KEY=' 
format
+  [255]
diff --git a/tests/test-completion.t b/tests/test-completion.t
--- a/tests/test-completion.t
+++ b/tests/test-completion.t
@@ -228,7 +228,7 @@
   log: follow, follow-first, date, copies, keyword, rev, removed, only-merges, 
user, only-branch, branch, prune, patch, git, limit, no-merges, stat, graph, 
style, template, include, exclude
   merge: force, rev, preview, tool
   pull: update, force, rev, bookmark, branch, ssh, remotecmd, insecure
-  push: force, rev, bookmark, branch, new-branch, ssh, remotecmd, insecure
+  push: force, rev, bookmark, branch, new-branch, pushvars, ssh, remotecmd, 
insecure
   remove: after, force, subrepos, include, exclude
   serve: accesslog, daemon, daemon-postexec, errorlog, port, address, prefix, 
name, web-conf, webdir-conf, pid-file, stdio, cmdserver, templates, style, 
ipv6, certificate, subrepos
   status: all, modified, added, removed, deleted, clean, unknown, ignored, 
no-status, terse, copies, print0, rev, change, include, exclude, subrepos, 
template
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -891,6 +891,14 @@
 pushop.bkresult = 1
 return handlereply
 
+@b2partsgenerator('pushvars', idx=0)
+def _getbundlesendvars(pushop, bundler):
+'''send shellvars via bundle2'''
+if getattr(pushop.repo, '_shellvars', ()):
+part = bundler.newpart('pushvars')
+
+for key, value in pushop.repo._shellvars.iteritems():
+part.addparam(key, value, mandatory=False)
 
 def _pushbundle2(pushop):
 """push data to the remote using bundle2
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3970,6 +3970,7 @@
 ('b', 'branch', [],
  _('a specific branch you would like to push'), _('BRANCH')),
 ('', 'new-branch', False, _('allow pushing a new branch')),
+('', 'pushvars', [], _('variables that can be sent to server (ADVANCED)')),
 ] + remoteopts,
 _('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]'))
 def push(ui, repo, dest=None, **opts):
@@ -4007,6 +4008,25 @@
 Please see :hg:`help urls` for important details about ``ssh://``
 URLs. If DESTINATION is omitted, a default path will be used.
 
+.. container:: verbose
+
+The --pushvars option sends strings to the server that become
+environment variables prepended with ``HG_USERVAR_``. For example,
+``--pushvars ENABLE_FEATURE=true``, provides the server side hooks with
+``HG_USERVAR_ENABLE_FEATURE=true`` as part of their environment.
+
+pushvars can provide for user-overridable hooks as well as set 

D218: phabricator: add --confirm option to phabsend command

2017-08-02 Thread pulkit (Pulkit Goyal)
pulkit updated this revision to Diff 515.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D218?vs=513&id=515

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

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -313,7 +313,8 @@
 
 @command('phabsend',
  [('r', 'rev', [], _('revisions to send'), _('REV')),
-  ('', 'reviewer', [], _('specify reviewers'))],
+  ('', 'reviewer', [], _('specify reviewers')),
+  ('', 'confirm', None, _('ask for confirmation before sending'))],
  _('REV [OPTIONS]'))
 def phabsend(ui, repo, *revs, **opts):
 """upload changesets to Phabricator
@@ -326,13 +327,27 @@
 maintain the association. After the first time, phabsend will check
 obsstore and tags information so it can figure out whether to update an
 existing Differential Revision, or create a new one.
+
+The --confirm option lets you confirm changesets before sending them. You
+can also add following to your configuration file to make it default
+behaviour.
+
+[phabsend]
+confirm = true
 """
 revs = list(revs) + opts.get('rev', [])
 revs = scmutil.revrange(repo, revs)
 
 if not revs:
 raise error.Abort(_('phabsend requires at least one changeset'))
 
+confirm = ui.configbool('phabsend', 'confirm')
+confirm |= bool(opts.get('confirm'))
+if confirm:
+confirmed = _confirmbeforesend(repo, revs)
+if not confirmed:
+raise error.Abort(_('phabsend cancelled'))
+
 actions = []
 reviewers = opts.get('reviewer', [])
 if reviewers:
@@ -379,6 +394,20 @@
 _metanamemap = util.sortdict([(r'user', 'User'), (r'date', 'Date'),
   (r'node', 'Node ID'), (r'parent', 'Parent ')])
 
+def _confirmbeforesend(repo, revs):
+ui = repo.ui
+for rev in revs:
+ctx = repo[rev]
+desc = ctx.description().splitlines()[0]
+ui.write(('%d: ' % rev), label='phabsend.revnumber')
+ui.write(('%s\n' % desc), label='phabsend.desc')
+
+if ui.promptchoice(_('Phabsend the above changes (yn)?'
+'$$ &Yes $$ &No')):
+return False
+
+return True
+
 def querydrev(repo, params, stack=False):
 """return a list of "Differential Revision" dicts
 



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


[Bug 5648] New: Phase not preserved as part of streaming clone

2017-08-02 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=5648

Bug ID: 5648
   Summary: Phase not preserved as part of streaming clone
   Product: Mercurial
   Version: default branch
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: bug
  Priority: normal
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: gregory.sz...@gmail.com
CC: mercurial-devel@mercurial-scm.org

`hg clone --uncompressed` won't preserve phases from the server.

If you clone from a repo that has draft changesets, their phase gets promoted
to public when you `hg clone --uncompressed`, even if the server is marked as
non-publishing.

If you clone from a repo that has hidden changesets using `hg clone
--uncompressed`, those hidden changesets get transferred and their phase is
promoted to public, causing the obsolescence marker to get ignored and the
changeset to appear visible.

I want to say this is a regression between 4.1 and 4.2 because attempting to
upgrade 4.1 to 4.2 in some test files at Mozilla helped uncover this issue. But
I can reproduce the bad behavior with a standalone .t test using 4.1. So I
dunno what's going on.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D219: morestatus: move fb extension to core as '--repo-state' option to status

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

REVISION SUMMARY
  morestatus extension in fbext use to show more context about the state of the
  repo like the repository is in a unfinished merge state, or a rebase is going
  on, or histedit is going on, listing the files which need to be resolved and
  also suggesting ways to handle the situation.
  
  This patch moves the extension directly to core with '--repo-state' flag to
  status command. The extension also shows context about unfinished update state
  which is not ported to core as that plug in hooks to update command which need
  to be tackled somewhat differently.
  
  The following configuration will turn the behaviour on by default
  
  [morestatus]
  show = true
  
  You can also skip considering some states like bisect as follows:
  
  [morestatus]
  skipstates=bisect
  
  This patch also adds test for the feature.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/commands.py
  tests/test-bisect.t
  tests/test-completion.t
  tests/test-conflict.t
  tests/test-graft.t
  tests/test-help.t
  tests/test-histedit-fold.t
  tests/test-rebase-conflicts.t
  tests/test-shelve.t

CHANGE DETAILS

diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -342,6 +342,23 @@
   warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
   unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
   [1]
+  $ hg status --repo-state
+  M a/a
+  M b.rename/b
+  M c.copy
+  R b/b
+  ? a/a.orig
+  # The repository is in an unfinished *unshelve* state.
+  
+  # Unresolved merge conflicts:
+  # 
+  # a/a
+  # 
+  # To mark files as resolved:  hg resolve --mark FILE
+  
+  # To continue:hg unshelve --continue
+  # To abort:   hg unshelve --abort
+  
 
 ensure that we have a merge with unresolved conflicts
 
diff --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t
--- a/tests/test-rebase-conflicts.t
+++ b/tests/test-rebase-conflicts.t
@@ -71,6 +71,21 @@
   unresolved conflicts (see hg resolve, then hg rebase --continue)
   [1]
 
+  $ hg status --repo-state
+  M common
+  ? common.orig
+  # The repository is in an unfinished *rebase* state.
+  
+  # Unresolved merge conflicts:
+  # 
+  # common
+  # 
+  # To mark files as resolved:  hg resolve --mark FILE
+  
+  # To continue:hg rebase --continue
+  # To abort:   hg rebase --abort
+  
+
 Try to continue without solving the conflict:
 
   $ hg rebase --continue
diff --git a/tests/test-histedit-fold.t b/tests/test-histedit-fold.t
--- a/tests/test-histedit-fold.t
+++ b/tests/test-histedit-fold.t
@@ -294,9 +294,20 @@
   [1]
 There were conflicts, we keep P1 content. This
 should effectively drop the changes from +6.
-  $ hg status
+  $ hg status --repo-state
   M file
   ? file.orig
+  # The repository is in an unfinished *histedit* state.
+  
+  # Unresolved merge conflicts:
+  # 
+  # file
+  # 
+  # To mark files as resolved:  hg resolve --mark FILE
+  
+  # To continue:hg histedit --continue
+  # To abort:   hg histedit --abort
+  
   $ hg resolve -l
   U file
   $ hg revert -r 'p1()' file
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -617,6 +617,7 @@
-0 --print0  end filenames with NUL, for use with xargs
   --rev REV [+] show difference from revision
   --change REV  list the changed files of a revision
+  --repo-state  show the state of the repo
-I --include PATTERN [+] include names matching the given patterns
-X --exclude PATTERN [+] exclude names matching the given patterns
-S --subreposrecurse into subrepositories
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -221,6 +221,25 @@
   $ hg summary |grep graft
   commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
 
+Using status to get more context
+
+  $ hg status --repo-state
+  M d
+  M e
+  ? a.orig
+  ? e.orig
+  # The repository is in an unfinished *graft* state.
+  
+  # Unresolved merge conflicts:
+  # 
+  # e
+  # 
+  # To mark files as resolved:  hg resolve --mark FILE
+  
+  # To continue:hg graft --continue
+  # To abort:   hg update --clean .(warning: this will 
discard uncommitted changes)
+  
+
 Commit while interrupted should fail:
 
   $ hg ci -m 'commit interrupted graft'
diff --git a/tests/test-conflict.t b/tests/test-conflict.t
--- a/tests/test-conflict.t
+++ b/tests/test-conflict.t
@@ -44,6 +44,21 @@
   $ hg id
   618808747361+c0c68e4fe667+ tip
 
+  $ hg status --repo-state
+  M a
+  ? a.orig
+  # The repository is in an unfinished *merge* state.
+  
+  # 

D219: morestatus: move fb extension to core as '--repo-state' option to status

2017-08-02 Thread pulkit (Pulkit Goyal)
pulkit added a subscriber: durham.
pulkit added a comment.


  @durham and I thought on the flag name and had '--more' and '--repo-state' in 
our mind. Since '--repo-state' is more explicit, I went with that. Need 
suggestions for a better flag name. :)

REPOSITORY
  rHG Mercurial

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

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


D219: morestatus: move fb extension to core as '--repo-state' option to status

2017-08-02 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D219#3558, @pulkit wrote:
  
  > @durham and I thought on the flag name and had '--more' and '--repo-state' 
in our mind. Since '--repo-state' is more explicit, I went with that. Need 
suggestions for a better flag name. :)
  
  
  Do we need a flag? Why not just a config option (whose value is ignored with 
HGPLAIN)?

REPOSITORY
  rHG Mercurial

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

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


D219: morestatus: move fb extension to core as '--repo-state' option to status

2017-08-02 Thread akushner (Aaron Kushner)
akushner added a comment.


  So what does '--verbose' do for status currently? Didn't seem to do anything. 
Can this output be for verbose?

REPOSITORY
  rHG Mercurial

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

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


D219: morestatus: move fb extension to core as '--repo-state' option to status

2017-08-02 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D219#3562, @akushner wrote:
  
  > So what does '--verbose' do for status currently? Didn't seem to do 
anything. Can this output be for verbose?
  
  
  Good question. From 
https://www.mercurial-scm.org/wiki/CompatibilityRules#Commands: "Adding 
messages at the verbose level is also usually acceptable."
  
  I think it makes sense for this output to be part of the verbose form.
  
  It would still be nice to have a config option for it. I don't like 
"morestatus" for that. I would think it should be in commands.status (along 
with ".relative"). Maybe commands.status.verbose=1 to enable it if we decide to 
use the --verbose flag for it.

REPOSITORY
  rHG Mercurial

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

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


D219: morestatus: move fb extension to core as '--repo-state' option to status

2017-08-02 Thread akushner (Aaron Kushner)
akushner added a comment.


  @martinvonz - I like the commands.status.verbose=1 option. I think the 
verbose form of status makes sense when there's a large body of unsophisticated 
source control users and the more details on how to get out of the current 
predicament, the better.

REPOSITORY
  rHG Mercurial

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

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


D219: morestatus: move fb extension to core as '--repo-state' option to status

2017-08-02 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  @akushner @martinvonz : thanks for suggestions.  I also like the --verbose 
option, I will send a new version with that.
  @martinvonz: Since you don't like 'morestatus' much, shall I place the 
skipstates option which skips some states under some different config name, 
maybe status.skipstates?

REPOSITORY
  rHG Mercurial

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

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


D219: morestatus: move fb extension to core as '--repo-state' option to status

2017-08-02 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D219#3566, @pulkit wrote:
  
  > @akushner @martinvonz : thanks for suggestions.  I also like the --verbose 
option, I will send a new version with that.
  >  @martinvonz: Since you don't like 'morestatus' much, shall I place the 
skipstates option which skips some states under some different config name, 
maybe status.skipstates?
  
  
  I'm not 100% sure, but I think we're trying to put command-specific configs 
under command., so it would probably be commands.status.skipstates. 
Also, shouldn't you be putting it in configitems.py?

REPOSITORY
  rHG Mercurial

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

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


D220: rpms: add chg

2017-08-02 Thread Mathias De Maré
Mathiasdm created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I'm not sure if there's a reason chg is not added by default.
  If not, I would like to propose adding in this patch.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/mercurial.spec

CHANGE DETAILS

diff --git a/contrib/mercurial.spec b/contrib/mercurial.spec
--- a/contrib/mercurial.spec
+++ b/contrib/mercurial.spec
@@ -83,6 +83,7 @@
 %endif
 
 make all
+make -C contrib/chg
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -111,6 +112,7 @@
 
 %endif
 
+install -m 755 contrib/chg/chg $RPM_BUILD_ROOT%{_bindir}/
 install -m 755 contrib/hgk $RPM_BUILD_ROOT%{_bindir}/
 install -m 755 contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir}/
 
@@ -143,6 +145,7 @@
 %{_datadir}/emacs/site-lisp/mercurial.el
 %{_datadir}/emacs/site-lisp/mq.el
 %{_bindir}/hg
+%{_bindir}/chg
 %{_bindir}/hgk
 %{_bindir}/hg-ssh
 %dir %{_sysconfdir}/bash_completion.d/



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