D6837: cleanup: fix leakage of dirstate._map to client code

2019-09-11 Thread durin42 (Augie Fackler)
Closed by commit rHG34ed651ba7e4: cleanup: fix leakage of dirstate._map to 
client code (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6837?vs=16505&id=16521

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6837/new/

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

AFFECTED FILES
  hgext/largefiles/reposetup.py
  mercurial/debugcommands.py
  mercurial/scmutil.py

CHANGE DETAILS

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -319,7 +319,7 @@
 def __init__(self, ui, abort, dirstate):
 self._ui = ui
 self._abort = abort
-allfiles = '\0'.join(dirstate._map)
+allfiles = '\0'.join(dirstate)
 self._loweredfiles = set(encoding.lower(allfiles).split('\0'))
 self._dirstate = dirstate
 # The purpose of _newfiles is so that we don't complain about
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -751,7 +751,7 @@
 keyfunc = lambda x: (x[1][3], x[0]) # sort by mtime, then by filename
 else:
 keyfunc = None # sort by filename
-for file_, ent in sorted(repo.dirstate._map.iteritems(), key=keyfunc):
+for file_, ent in sorted(repo.dirstate.iteritems(), key=keyfunc):
 if ent[3] == -1:
 timestr = 'unset   '
 elif nodates:
diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py
+++ b/hgext/largefiles/reposetup.py
@@ -234,7 +234,7 @@
 result[2] = [f for f in result[2]
  if f not in lfdirstate]
 
-lfiles = set(lfdirstate._map)
+lfiles = set(lfdirstate)
 # Unknown files
 result[4] = set(result[4]).difference(lfiles)
 # Ignored files



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


D6776: bookmarks: validate changes on push (issue6193) (BC)

2019-09-11 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  I agree with @valentin.gatienbaron that `--force` is quite generic :(.  It 
may create new heads on the server even if I don't want to.

INLINE COMMENTS

> bundle2.py:2149
> +hint=
> +_("run 'hg pull', resolve conflicts, and push 
> again"))
> +hookargs = tr.hookargs.copy()

Hm, I think `conflicts` can be confusing but I don't have better suggestions 
here.

> repository.py:194
>  
> -def unbundle(bundle, heads, url):
> +def unbundle(bundle, heads, url, force=None):
>  """Transfer repository data to the peer.

It will be nice to have documentation about what `force` does in the interface.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6776/new/

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

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


D4664: mergecommit: add a new extension to merge in-memory and create a commit

2019-09-11 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  In D4664#100404 , @durin42 wrote:
  
  > Neat. I assume you normally check these out later?
  
  For now yes. The plan was to make `hg cat` support cat-ing maultiple files 
preventing to checkout.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D4664/new/

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

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


D6738: unshelve: add --unresolved flag to unshelve mergestate with unresolved files

2019-09-11 Thread pulkit (Pulkit Goyal)
pulkit added inline comments.

INLINE COMMENTS

> pulkit wrote in shelve.py:754
> Then we are somehow parsing or building the records in not correct way.

Did you manage to find why that error comes up?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6738/new/

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

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


D6736: shelve: add method for storing mergestate in changeset extras

2019-09-11 Thread pulkit (Pulkit Goyal)
pulkit added inline comments.

INLINE COMMENTS

> navaneeth.suresh wrote in shelve.py:416
> i feel like the current approach is more simpler and easy to understand.

It will be nice to use only way to encode mergestates at all the places.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6736/new/

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

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


D6735: update: added support for --abort flag(issue4404)

2019-09-11 Thread mharbison72 (Matt Harbison)
This revision now requires changes to proceed.
mharbison72 added a comment.
mharbison72 requested changes to this revision.


  Oops, meant to flag changes needed too.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6735/new/

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

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


D6735: update: added support for --abort flag(issue4404)

2019-09-11 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment.


  In D6735#100392 , @durin42 wrote:
  
  > This looks good to me. Does anyone else have comments? @mharbison72 are you 
happy with the subrepo test coverage?
  
  I forgot about this, thanks for the reminder.  @taapas1128 is correct- the 
subrepos aren't being initialized as subrepos (i.e. there's no .hgsub file).  
I'll try to play with this more Friday or over the weekend.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6735/new/

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

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


mercurial@42925: 6 new changesets

2019-09-11 Thread Mercurial Commits
6 new changesets in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/a50661567f83
changeset:   42920:a50661567f83
user:Matt Harbison 
date:Tue Sep 10 22:04:22 2019 -0400
summary: uncommit: drop the hyphen from --current-user and --current-date

https://www.mercurial-scm.org/repo/hg/rev/4690902850df
changeset:   42921:4690902850df
user:Matt Harbison 
date:Tue Sep 10 22:52:04 2019 -0400
summary: uncommit: make -D/--date and -U/--user mutually exclusive

https://www.mercurial-scm.org/repo/hg/rev/8d9322b6e687
changeset:   42922:8d9322b6e687
user:Connor Sheehan 
date:Tue Sep 10 12:32:07 2019 -0400
summary: hgweb: add a `message` attribute to `hgweb.common.ErrorResponse`

https://www.mercurial-scm.org/repo/hg/rev/a7abc6081bc5
changeset:   42923:a7abc6081bc5
user:Connor Sheehan 
date:Mon Sep 09 14:26:43 2019 -0400
summary: highlight: fix encoding issues to enable Py3 compatibility

https://www.mercurial-scm.org/repo/hg/rev/e0bf41b83cef
changeset:   42924:e0bf41b83cef
user:Valentin Gatien-Baron 
date:Sun Sep 08 20:10:32 2019 -0400
summary: exchange: avoid unnecessary conversion of bookmark nodes to hex 
(API)

https://www.mercurial-scm.org/repo/hg/rev/9fd7710d9ae2
changeset:   42925:9fd7710d9ae2
bookmark:@
tag: tip
user:Valentin Gatien-Baron 
date:Sun Sep 08 20:26:36 2019 -0400
summary: exchange: convert bookmark nodes from hex to bin ASAP

-- 
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


D6843: ui: option to preserve the progress bar

2019-09-11 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Some interface like the fast-import format of git are meant for pipe
  processing. It can be still desirable to have progress bars in this
  case, but clearing the bar after each output operation is not desirable.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1023,8 +1023,9 @@
 self._buffers[-1].extend(args)
 return
 
-# inliend _writenobuf() for speed
-self._progclear()
+# inlined _writenobuf() for speed
+if not opts.get(r'keepprogressbar', False):
+self._progclear()
 msg = b''.join(args)
 
 # opencode timeblockedsection because this is a critical path
@@ -1061,7 +1062,8 @@
 
 def _writenobuf(self, dest, *args, **opts):
 # update write() as well if you touch this code
-self._progclear()
+if not opts.get(r'keepprogressbar', False):
+self._progclear()
 msg = b''.join(args)
 
 # opencode timeblockedsection because this is a critical path



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


D6776: bookmarks: validate changes on push (issue6193) (BC)

2019-09-11 Thread durin42 (Augie Fackler)
durin42 added a comment.


  We're really close. I've uploaded my rebase of this to the latest dev hg 
(along with some minor test fixes). There's now only one failure:
  
--- /Users/augie/Programming/hg/crew/tests/test-bookmarks-pushpull.t
+++ 
/Users/augie/Programming/hg/crew/tests/test-bookmarks-pushpull.t#b2-binary.err
@@ -820,15 +820,17 @@
   pushing to http://localhost:$HGPORT/
   searching for changes
   no changes found
-  updating bookmark Z
-  [1]
+  remote: push rejected: bookmark "Z" has changed
+  remote: (run 'hg pull', resolve conflicts, and push again)
+  abort: push failed on remote
+  [255]
   $ hg book -d Z
   $ hg in -B http://localhost:$HGPORT/
   comparing with http://localhost:$HGPORT/
   searching for changed bookmarks
  @ 9b140be10808
  X 9b140be10808
- Z 0d2164f0ce0d
+ Z 9b140be10808
  foo   
  foobar9b140be10808
   $ hg pull -B Z http://localhost:$HGPORT/
@@ -853,7 +855,7 @@
* @ 1:9b140be10808
  X 1:9b140be10808
  Y 4:c922c0139ca0
- Z 2:0d2164f0ce0d
+ Z 1:9b140be10808
  foo   -1:
  foobar1:9b140be10808
 

ERROR: test-bookmarks-pushpull.t#b2-binary output changed
  
  My gut at this point is that we should:
  
  1. Document that legacy bookmark push behavior over pushkey is different
  2. Add a config to reject bookmark pushes over pushkey
  
  But if there's a way to fix the pushkey behavior too, I'd be interested in 
that. I'm just not sure it's worth blocking on when that should only matter 
with very old servers. Obviously if others have stronger opinions they should 
speak up.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6776/new/

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

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


D6776: bookmarks: validate changes on push (issue6193) (BC)

2019-09-11 Thread durin42 (Augie Fackler)
durin42 updated this revision to Diff 16519.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6776?vs=16518&id=16519

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6776/new/

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

AFFECTED FILES
  mercurial/bundle2.py
  mercurial/exchange.py
  mercurial/interfaces/repository.py
  mercurial/localrepo.py
  mercurial/wireprotov1peer.py
  tests/test-bookmarks-conflict.t
  tests/test-hook.t

CHANGE DETAILS

diff --git a/tests/test-hook.t b/tests/test-hook.t
--- a/tests/test-hook.t
+++ b/tests/test-hook.t
@@ -545,6 +545,7 @@
   HG_URL=file:$TESTTMP/a
   
   pushkey hook: HG_BUNDLE2=1
+  HG_FORCE=0
   HG_HOOKNAME=pushkey
   HG_HOOKTYPE=pushkey
   HG_KEY=foo
@@ -632,6 +633,7 @@
   HG_TXNNAME=push
   
   prepushkey.forbid hook: HG_BUNDLE2=1
+  HG_FORCE=0
   HG_HOOKNAME=prepushkey
   HG_HOOKTYPE=prepushkey
   HG_KEY=baz
diff --git a/tests/test-bookmarks-conflict.t b/tests/test-bookmarks-conflict.t
new file mode 100644
--- /dev/null
+++ b/tests/test-bookmarks-conflict.t
@@ -0,0 +1,91 @@
+initialize
+  $ make_changes() {
+  > d=`pwd`
+  > [ ! -z $1 ] && cd $1
+  > echo "test `basename \`pwd\``" >> test
+  > hg commit -Am"${2:-test}"
+  > r=$?
+  > cd $d
+  > return $r
+  > }
+  $ ls -1a
+  .
+  ..
+  $ hg init a
+  $ cd a
+  $ echo 'test' > test; hg commit -Am'test'
+  adding test
+  $ hg book @
+
+clone to b
+
+  $ mkdir ../b
+  $ cd ../b
+  $ hg clone ../a .
+  updating to bookmark @
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ make_changes
+  $ hg book bk_b
+
+clone to c
+  $ mkdir ../c
+  $ cd ../c
+  $ hg clone ../a .
+  updating to bookmark @
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ make_changes
+  $ hg book bk_c
+
+push from b
+  $ cd ../b
+  $ hg push -B .
+  pushing to $TESTTMP/a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating bookmark @
+  exporting bookmark bk_b
+  $ hg -R ../a id -r @
+  e11a942451be tip @/bk_b
+
+push from c
+  $ cd ../c
+  $ hg push -B .
+  pushing to $TESTTMP/a
+  searching for changes
+  remote has heads on branch 'default' that are not known locally: e11a942451be
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  exporting bookmark bk_c
+  $ hg push -B @
+  pushing to $TESTTMP/a
+  searching for changes
+  no changes found
+  abort: push rejected: bookmark "@" has changed
+  (run 'hg pull', resolve conflicts, and push again)
+  [255]
+  $ hg -R ../a log -G -T '{rev} {bookmarks}'
+  o  2 bk_c
+  |
+  | o  1 @ bk_b
+  |/
+  @  0
+  
+
+  $ hg push -B @ --force
+  pushing to $TESTTMP/a
+  searching for changes
+  no changes found
+  updating bookmark @
+  [1]
+  $ hg -R ../a log -G -T '{rev} {bookmarks}'
+  o  2 @ bk_c
+  |
+  | o  1 bk_b
+  |/
+  @  0
+  
diff --git a/mercurial/wireprotov1peer.py b/mercurial/wireprotov1peer.py
--- a/mercurial/wireprotov1peer.py
+++ b/mercurial/wireprotov1peer.py
@@ -445,7 +445,7 @@
 else:
 return changegroupmod.cg1unpacker(f, 'UN')
 
-def unbundle(self, bundle, heads, url):
+def unbundle(self, bundle, heads, url, force=None):
 '''Send cg (a readable file-like object representing the
 changegroup to push, typically a chunkbuffer object) to the
 remote server as a bundle.
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -308,14 +308,15 @@
 raise error.Abort(_('cannot perform stream clone against local '
 'peer'))
 
-def unbundle(self, bundle, heads, url):
+def unbundle(self, bundle, heads, url, force=None):
 """apply a bundle on a repo
 
 This function handles the repo locking itself."""
 try:
 try:
 bundle = exchange.readbundle(self.ui, bundle, None)
-ret = exchange.unbundle(self._repo, bundle, heads, 'push', url)
+ret = exchange.unbundle(
+self._repo, bundle, heads, 'push', url, force=force)
 if util.safehasattr(ret, 'getchunks'):
 # This is a bundle20 object, turn it into an unbundler.
 # This little dance should be dropped eventually when the
diff --git a/mercurial/interfaces/repository.py 
b/mercurial/interfaces/repository.py
--- a/mercurial/interfaces/repository.py
+++ b/mercurial/interfaces/repository.py
@@ -191,7 +191,7 @@
 Successful result should be a generator of data chunks.
 """
 
-def unbundle(bundle, heads, url):
+def unbundle(bundle, heads, url, force=None):
 """Transfer repository data to the peer.
 
 This is how the bulk of data during a push is transferred.
diff --git a/mercurial/exchange.py b/mercurial/e

D6735: update: added support for --abort flag(issue4404)

2019-09-11 Thread taapas1128 (Taapas Agrawal)
taapas1128 added a comment.
taapas1128 marked an inline comment as done.


  @durin42 I don't think the subrepos are properly initialized in the tests. I 
would be updating them soon.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6735/new/

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

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


D6776: bookmarks: validate changes on push (issue6193) (BC)

2019-09-11 Thread idlsoft (Sandu Turcan)
idlsoft updated this revision to Diff 16518.

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6776?vs=16515&id=16518

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6776/new/

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

AFFECTED FILES
  mercurial/bundle2.py
  mercurial/exchange.py
  mercurial/localrepo.py
  mercurial/repository.py
  mercurial/wireprotov1peer.py
  tests/test-bookmarks-conflict.t

CHANGE DETAILS

diff --git a/tests/test-bookmarks-conflict.t b/tests/test-bookmarks-conflict.t
new file mode 100644
--- /dev/null
+++ b/tests/test-bookmarks-conflict.t
@@ -0,0 +1,91 @@
+initialize
+  $ make_changes() {
+  > d=`pwd`
+  > [ ! -z $1 ] && cd $1
+  > echo "test `basename \`pwd\``" >> test
+  > hg commit -Am"${2:-test}"
+  > r=$?
+  > cd $d
+  > return $r
+  > }
+  $ ls -1a
+  .
+  ..
+  $ hg init a
+  $ cd a
+  $ echo 'test' > test; hg commit -Am'test'
+  adding test
+  $ hg book @
+
+clone to b
+
+  $ mkdir ../b
+  $ cd ../b
+  $ hg clone ../a .
+  updating to bookmark @
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ make_changes
+  $ hg book bk_b
+
+clone to c
+  $ mkdir ../c
+  $ cd ../c
+  $ hg clone ../a .
+  updating to bookmark @
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ make_changes
+  $ hg book bk_c
+
+push from b
+  $ cd ../b
+  $ hg push -B .
+  pushing to $TESTTMP/a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating bookmark @
+  exporting bookmark bk_b
+  $ hg -R ../a id -r @
+  e11a942451be tip @/bk_b
+
+push from c
+  $ cd ../c
+  $ hg push -B .
+  pushing to $TESTTMP/a
+  searching for changes
+  remote has heads on branch 'default' that are not known locally: e11a942451be
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  exporting bookmark bk_c
+  $ hg push -B @
+  pushing to $TESTTMP/a
+  searching for changes
+  no changes found
+  abort: push rejected: bookmark "@" has changed
+  (run 'hg pull', resolve conflicts, and push again)
+  [255]
+  $ hg -R ../a log -G -T '{rev} {bookmarks}'
+  o  2 bk_c
+  |
+  | o  1 @ bk_b
+  |/
+  @  0
+  
+
+  $ hg push -B @ --force
+  pushing to $TESTTMP/a
+  searching for changes
+  no changes found
+  updating bookmark @
+  [1]
+  $ hg -R ../a log -G -T '{rev} {bookmarks}'
+  o  2 @ bk_c
+  |
+  | o  1 bk_b
+  |/
+  @  0
+  
diff --git a/mercurial/wireprotov1peer.py b/mercurial/wireprotov1peer.py
--- a/mercurial/wireprotov1peer.py
+++ b/mercurial/wireprotov1peer.py
@@ -445,7 +445,7 @@
 else:
 return changegroupmod.cg1unpacker(f, 'UN')
 
-def unbundle(self, bundle, heads, url):
+def unbundle(self, bundle, heads, url, force=None):
 '''Send cg (a readable file-like object representing the
 changegroup to push, typically a chunkbuffer object) to the
 remote server as a bundle.
diff --git a/mercurial/repository.py b/mercurial/repository.py
--- a/mercurial/repository.py
+++ b/mercurial/repository.py
@@ -191,7 +191,7 @@
 Successful result should be a generator of data chunks.
 """
 
-def unbundle(bundle, heads, url):
+def unbundle(bundle, heads, url, force=None):
 """Transfer repository data to the peer.
 
 This is how the bulk of data during a push is transferred.
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -306,14 +306,14 @@
 raise error.Abort(_('cannot perform stream clone against local '
 'peer'))
 
-def unbundle(self, bundle, heads, url):
+def unbundle(self, bundle, heads, url, force=None):
 """apply a bundle on a repo
 
 This function handles the repo locking itself."""
 try:
 try:
 bundle = exchange.readbundle(self.ui, bundle, None)
-ret = exchange.unbundle(self._repo, bundle, heads, 'push', url)
+ret = exchange.unbundle(self._repo, bundle, heads, 'push', 
url, force=force)
 if util.safehasattr(ret, 'getchunks'):
 # This is a bundle20 object, turn it into an unbundler.
 # This little dance should be dropped eventually when the
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1159,6 +1159,7 @@
 'bundle': stream,
 'heads': ['force'],
 'url': pushop.remote.url(),
+'force': pushop.force,
 }).result()
 except error.BundleValueError as exc:
 raise error.Abort(_('missing support for %s') % exc)
@@ -2375,7 +2376,7 @@
 raise error.PushRaced('repository changed while %s - '
   'please try again' %

D6831: exchange: convert bookmark nodes from hex to bin ASAP

2019-09-11 Thread valentin.gatienbaron (Valentin Gatien-Baron)
Closed by commit rHG9fd7710d9ae2: exchange: convert bookmark nodes from hex to 
bin ASAP (authored by valentin.gatienbaron).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs 
Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6831?vs=16452&id=16517

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6831/new/

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

AFFECTED FILES
  mercurial/exchange.py

CHANGE DETAILS

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -708,12 +708,11 @@
 revnums = pycompat.maplist(repo.changelog.rev, pushop.revs)
 ancestors = repo.changelog.ancestors(revnums, inclusive=True)
 
-remotebookmark = listkeys(remote, 'bookmarks')
+remotebookmark = bookmod.unhexlifybookmarks(listkeys(remote, 'bookmarks'))
 
 explicit = {repo._bookmarks.expandname(bookmark)
 for bookmark in pushop.bookmarks}
 
-remotebookmark = bookmod.unhexlifybookmarks(remotebookmark)
 comp = bookmod.comparebookmarks(repo, repo._bookmarks, remotebookmark)
 return _processcompared(pushop, ancestors, explicit, remotebookmark, comp)
 



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


D6830: exchange: avoid unnecessary conversion of bookmark nodes to hex (API)

2019-09-11 Thread valentin.gatienbaron (Valentin Gatien-Baron)
Closed by commit rHGe0bf41b83cef: exchange: avoid unnecessary conversion of 
bookmark nodes to hex (API) (authored by valentin.gatienbaron).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs 
Review".

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D6830?vs=16451&id=16516#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6830?vs=16451&id=16516

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6830/new/

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

AFFECTED FILES
  mercurial/exchange.py

CHANGE DETAILS

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -12,7 +12,6 @@
 
 from .i18n import _
 from .node import (
-bin,
 hex,
 nullid,
 nullrev,
@@ -441,7 +440,7 @@
 self.fallbackoutdatedphases = None
 # outgoing obsmarkers
 self.outobsmarkers = set()
-# outgoing bookmarks
+# outgoing bookmarks, list of (bm, oldnode | '', newnode | '')
 self.outbookmarks = []
 # transaction manager
 self.trmanager = None
@@ -716,17 +715,6 @@
 
 remotebookmark = bookmod.unhexlifybookmarks(remotebookmark)
 comp = bookmod.comparebookmarks(repo, repo._bookmarks, remotebookmark)
-
-def safehex(x):
-if x is None:
-return x
-return hex(x)
-
-def hexifycompbookmarks(bookmarks):
-return [(b, safehex(scid), safehex(dcid))
-for (b, scid, dcid) in bookmarks]
-
-comp = [hexifycompbookmarks(marks) for marks in comp]
 return _processcompared(pushop, ancestors, explicit, remotebookmark, comp)
 
 def _processcompared(pushop, pushed, explicit, remotebms, comp):
@@ -877,7 +865,6 @@
 return
 data = []
 for book, old, new in pushop.outbookmarks:
-old = bin(old)
 data.append((book, old))
 checkdata = bookmod.binaryencode(data)
 bundler.newpart('check:bookmarks', data=checkdata)
@@ -1051,7 +1038,6 @@
 data = []
 for book, old, new in pushop.outbookmarks:
 _abortonsecretctx(pushop, new, book)
-new = bin(new)
 data.append((book, new))
 allactions.append((book, _bmaction(old, new)))
 checkdata = bookmod.binaryencode(data)
@@ -1083,8 +1069,8 @@
 part = bundler.newpart('pushkey')
 part.addparam('namespace', enc('bookmarks'))
 part.addparam('key', enc(book))
-part.addparam('old', enc(old))
-part.addparam('new', enc(new))
+part.addparam('old', enc(hex(old)))
+part.addparam('new', enc(hex(new)))
 action = 'update'
 if not old:
 action = 'export'
@@ -1339,8 +1325,8 @@
 r = e.callcommand('pushkey', {
 'namespace': 'bookmarks',
 'key': b,
-'old': old,
-'new': new,
+'old': hex(old),
+'new': hex(new),
 }).result()
 
 if r:



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


D4664: mergecommit: add a new extension to merge in-memory and create a commit

2019-09-11 Thread durin42 (Augie Fackler)
durin42 added a comment.


  Neat. I assume you normally check these out later?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D4664/new/

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

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


D6659: graft: split graft code into seperate functions

2019-09-11 Thread durin42 (Augie Fackler)
This revision now requires changes to proceed.
durin42 added inline comments.
durin42 requested changes to this revision.

INLINE COMMENTS

> cmdutil.py:3497
> +
> +def updateopts(repo, graftstate, opts):
> +"""updates opts and nodes from graftstate in case graft

This function is still mutating the opts parameter. You could fix that by doing 
opts=dict(opts) on the first line if you want, or otherwise making a copy.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6659/new/

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

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


D6735: update: added support for --abort flag(issue4404)

2019-09-11 Thread durin42 (Augie Fackler)
durin42 added a comment.
durin42 accepted this revision as: durin42.


  This looks good to me. Does anyone else have comments? @mharbison72 are you 
happy with the subrepo test coverage?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6735/new/

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

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


D6709: config: add --registered flag to show all known configs

2019-09-11 Thread durin42 (Augie Fackler)
durin42 added a comment.
durin42 accepted this revision.


  I'm okay with this as-is. Barring an objection in a week or so I'll queue it.
  
  (It's also possible I've missed something important when I read through the 
extensive review history here. Apologies if true, but please restate your 
concerns if you still have them on the current version of the patch.)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6709/new/

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

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


D6776: bookmarks: validate changes on push (issue6193) (BC)

2019-09-11 Thread durin42 (Augie Fackler)
durin42 edited the summary of this revision.
durin42 retitled this revision from "bookmarks: validate changes on push" to 
"bookmarks: validate changes on push (issue6193) (BC)".
durin42 updated this revision to Diff 16515.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6776?vs=16341&id=16515

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6776/new/

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

AFFECTED FILES
  mercurial/bundle2.py
  mercurial/exchange.py
  mercurial/localrepo.py
  tests/test-bookmarksconflict.t

CHANGE DETAILS

diff --git a/tests/test-bookmarksconflict.t b/tests/test-bookmarksconflict.t
new file mode 100644
--- /dev/null
+++ b/tests/test-bookmarksconflict.t
@@ -0,0 +1,84 @@
+initialize
+  $ make_changes() {
+  > d=`pwd`
+  > [ ! -z $1 ] && cd $1
+  > echo "test `basename \`pwd\``" >> test
+  > hg commit -Am"${2:-test}"
+  > r=$?
+  > cd $d
+  > return $r
+  > }
+  $ ls -1a
+  .
+  ..
+  $ hg init a
+  $ cd a
+  $ echo 'test' > test; hg commit -Am'test'
+  adding test
+  $ hg book @
+
+clone to b
+
+  $ mkdir ../b
+  $ cd ../b
+  $ hg clone ../a .
+  updating to bookmark @
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ make_changes
+  $ hg book bk_b
+
+clone to c
+  $ mkdir ../c
+  $ cd ../c
+  $ hg clone ../a .
+  updating to bookmark @
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ make_changes
+  $ hg book bk_c
+
+push from b
+  $ cd ../b
+  $ hg push -B .
+  pushing to $TESTTMP/a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating bookmark @
+  exporting bookmark bk_b
+  $ hg -R ../a id -r @
+  e11a942451be tip @/bk_b
+
+push from c
+  $ cd ../c
+  $ hg push -B .
+  pushing to $TESTTMP/a
+  searching for changes
+  remote has heads on branch 'default' that are not known locally: e11a942451be
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  exporting bookmark bk_c
+  $ hg push -B @
+  pushing to $TESTTMP/a
+  searching for changes
+  no changes found
+  abort: push rejected: bookmark "@" has changed
+  (run 'hg pull', resolve conflicts, and push again)
+  [255]
+  $ hg -R ../a book
+   * @ 1:e11a942451be
+ bk_b  1:e11a942451be
+ bk_c  2:110743c8a16c
+  $ hg push -B @ --force
+  pushing to $TESTTMP/a
+  searching for changes
+  no changes found
+  updating bookmark @
+  [1]
+  $ hg -R ../a book
+   * @ 2:110743c8a16c
+ bk_b  1:e11a942451be
+ bk_c  2:110743c8a16c
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -308,14 +308,14 @@
 raise error.Abort(_('cannot perform stream clone against local '
 'peer'))
 
-def unbundle(self, bundle, heads, url):
+def unbundle(self, bundle, heads, url, force=None):
 """apply a bundle on a repo
 
 This function handles the repo locking itself."""
 try:
 try:
 bundle = exchange.readbundle(self.ui, bundle, None)
-ret = exchange.unbundle(self._repo, bundle, heads, 'push', url)
+ret = exchange.unbundle(self._repo, bundle, heads, 'push', 
url, force=force)
 if util.safehasattr(ret, 'getchunks'):
 # This is a bundle20 object, turn it into an unbundler.
 # This little dance should be dropped eventually when the
diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1161,6 +1161,7 @@
 'bundle': stream,
 'heads': ['force'],
 'url': pushop.remote.url(),
+'force': pushop.force,
 }).result()
 except error.BundleValueError as exc:
 raise error.Abort(_('missing support for %s') % exc)
@@ -2377,7 +2378,7 @@
 raise error.PushRaced('repository changed while %s - '
   'please try again' % context)
 
-def unbundle(repo, cg, heads, source, url):
+def unbundle(repo, cg, heads, source, url, force=None):
 """Apply a bundle to a repo.
 
 this function makes sure the repo is locked during the application and have
@@ -2426,7 +2427,8 @@
 
 op = bundle2.bundleoperation(repo, gettransaction,
  captureoutput=captureoutput,
- source='push')
+ source='push',
+ force=force)
 try:
 op = bundle2.processbundle(repo, cg, op=op)
  

D6776: bookmarks: validate changes on push (issue6193) (BC)

2019-09-11 Thread durin42 (Augie Fackler)
This revision now requires changes to proceed.
durin42 added a comment.
durin42 requested changes to this revision.


  I've uploaded my revised version (with the more complete commit message - no 
other changes) in case that helps.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6776/new/

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

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


D6776: bookmarks: validate changes on push

2019-09-11 Thread durin42 (Augie Fackler)
durin42 added a comment.


  I get a fair number of test failures with this, eg 
`test-bookmarks-corner-case.t`:
  
--- /usr/local/google/home/augie/hgtest/tests/test-bookmarks-corner-case.t
+++ 
/usr/local/google/home/augie/hgtest/tests/test-bookmarks-corner-case.t.err
@@ -178,11 +178,48 @@
   $ hg push -R client-B -r book-B
   pushing to ssh://user@dummy/bookrace-server
   searching for changes
-  remote: adding changesets
-  remote: adding manifests
-  remote: adding file changes
-  remote: added 1 changesets with 1 changes to 1 files
-  updating bookmark book-B
+  ** unknown exception encountered, please report by visiting
+  ** https://mercurial-scm.org/wiki/BugTracker
+  ** Python 2.7.16 (default, Apr  6 2019, 01:42:57) [GCC 7.3.0]
+  ** Mercurial Distributed SCM (version 5.1.1+253-85a0f0de90e5)
+  ** Extensions loaded:
+  Traceback (most recent call last):
+File "/tmp/hgtests.lYOPXh/install/bin/hg", line 43, in 
+  dispatch.run()
+File "/tmp/hgtests.lYOPXh/install/lib/python/mercurial/dispatch.py", 
line 99, in run
+  status = dispatch(req)
+File "/tmp/hgtests.lYOPXh/install/lib/python/mercurial/dispatch.py", 
line 225, in dispatch
+  ret = _runcatch(req) or 0
+File "/tmp/hgtests.lYOPXh/install/lib/python/mercurial/dispatch.py", 
line 376, in _runcatch
+  return _callcatch(ui, _runcatchfunc)
+File "/tmp/hgtests.lYOPXh/install/lib/python/mercurial/dispatch.py", 
line 384, in _callcatch
+  return scmutil.callcatch(ui, func)
+File "/tmp/hgtests.lYOPXh/install/lib/python/mercurial/scmutil.py", 
line 167, in callcatch
+  return func()
+File "/tmp/hgtests.lYOPXh/install/lib/python/mercurial/dispatch.py", 
line 367, in _runcatchfunc
+  return _dispatch(req)
+File "/tmp/hgtests.lYOPXh/install/lib/python/mercurial/dispatch.py", 
line 1021, in _dispatch
+  cmdpats, cmdoptions)
+File "/tmp/hgtests.lYOPXh/install/lib/python/mercurial/dispatch.py", 
line 756, in runcommand
+  ret = _runcommand(ui, options, cmd, d)
+File "/tmp/hgtests.lYOPXh/install/lib/python/mercurial/dispatch.py", 
line 1030, in _runcommand
+  return cmdfunc()
+File "/tmp/hgtests.lYOPXh/install/lib/python/mercurial/dispatch.py", 
line 1018, in 
+  d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
+File "/tmp/hgtests.lYOPXh/install/lib/python/mercurial/util.py", line 
1682, in check
+  return func(*args, **kwargs)
+File "/tmp/hgtests.lYOPXh/install/lib/python/mercurial/commands.py", 
line 4667, in push
+  opargs=opargs)
+File "/tmp/hgtests.lYOPXh/install/lib/python/mercurial/exchange.py", 
line 570, in push
+  _pushbundle2(pushop)
+File "/tmp/hgtests.lYOPXh/install/lib/python/mercurial/exchange.py", 
line 1164, in _pushbundle2
+  'force': pushop.force,
+File 
"/tmp/hgtests.lYOPXh/install/lib/python/mercurial/thirdparty/concurrent/futures/_base.py",
 line 457, in result
+  return self.__get_result()
+File 
"/tmp/hgtests.lYOPXh/install/lib/python/mercurial/wireprotov1peer.py", line 
211, in sendcommands
+  result = fn(**pycompat.strkwargs(args))
+  TypeError: unbundle() got an unexpected keyword argument 'force'
+  [1]
  
  Could I get you to take a look? I like where this is going, but I don't have 
the time at the moment to hunt down the issues in the tests.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6776/new/

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

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


D6776: bookmarks: validate changes on push

2019-09-11 Thread durin42 (Augie Fackler)
This revision is now accepted and ready to land.
durin42 added a comment.
durin42 accepted this revision.


  Queued this with lots of content added to the commit message. Thanks!

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6776/new/

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

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


D6837: cleanup: fix leakage of dirstate._map to client code

2019-09-11 Thread durin42 (Augie Fackler)
durin42 added a comment.


  In D6837#100331 , @mharbison72 
wrote:
  
  >> 2. In lfs, where we deal with standins and mutating status.
  >
  > s/lfs/largefiles/?
  
  Good catch, fixed.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6837/new/

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

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


D6773: rust-hgpath: add HgPath and HgPathBuf structs to encapsulate handling of paths

2019-09-11 Thread Raphaël Gomès
Alphare added a comment.


  I would love for this series to be queued. Is there anything I didn't address 
left to do?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6773/new/

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

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


D6821: flagprocessors: directly duplicate the deprecated layer back into revlog

2019-09-11 Thread marmoute (Pierre-Yves David)
marmoute added inline comments.

INLINE COMMENTS

> durin42 wrote in remotefilelog.py:311
> I'm not sure what this is telling me.  Is it saying that I want one of 
> processflags{raw,read,write}?
> 
> I missed this over the weekend when I wasn't coding (I don't do hg stuff on 
> weekends), but the message is sufficiently confusing I want to clean it up.

Yes, that's the message.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6821/new/

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

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


D6842: uncommit: make -D/--date and -U/--user mutually exclusive

2019-09-11 Thread mharbison72 (Matt Harbison)
Closed by commit rHG4690902850df: uncommit: make -D/--date and -U/--user 
mutually exclusive (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6842?vs=16510&id=16512

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6842/new/

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

AFFECTED FILES
  mercurial/cmdutil.py
  tests/test-uncommit.t

CHANGE DETAILS

diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t
--- a/tests/test-uncommit.t
+++ b/tests/test-uncommit.t
@@ -549,10 +549,18 @@
   date:Mon Jun 30 12:12:12 1980 +
   summary: uncommit with message
   
+Bad option combinations
+
+  $ hg rollback -q --config ui.rollback=True
+  $ hg uncommit -U --user 'user'
+  abort: --user and --currentuser are mutually exclusive
+  [255]
+  $ hg uncommit -D --date today
+  abort: --date and --currentdate are mutually exclusive
+  [255]
 
 `uncommit ` and `cd  && uncommit .` behave the same...
 
-  $ hg rollback -q --config ui.rollback=True
   $ echo 2 > dir/file2.txt
   $ hg ci -Aqm 'add file2 in directory'
   $ hg uncommit dir
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -185,10 +185,17 @@
 def resolvecommitoptions(ui, opts):
 """modify commit options dict to handle related options
 """
+if opts.get('date') and opts.get('currentdate'):
+raise error.Abort(_('--date and --currentdate are mutually '
+'exclusive'))
+if opts.get(b'user') and opts.get(b'currentuser'):
+raise error.Abort(_('--user and --currentuser are mutually '
+'exclusive'))
+
 # N.B. this is extremely similar to setupheaderopts() in mq.py
-if not opts.get(b'date') and opts.get(b'currentdate'):
+if opts.get(b'currentdate'):
 opts[b'date'] = b'%d %d' % dateutil.makedate()
-if not opts.get(b'user') and opts.get(b'currentuser'):
+if opts.get(b'currentuser'):
 opts[b'user'] = ui.username()
 
 def ishunk(x):



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


D6841: uncommit: drop the hyphen from --current-user and --current-date

2019-09-11 Thread mharbison72 (Matt Harbison)
Closed by commit rHGa50661567f83: uncommit: drop the hyphen from --current-user 
and --current-date (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6841?vs=16509&id=16511

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6841/new/

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

AFFECTED FILES
  mercurial/cmdutil.py
  tests/test-uncommit.t

CHANGE DETAILS

diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t
--- a/tests/test-uncommit.t
+++ b/tests/test-uncommit.t
@@ -42,8 +42,8 @@
-l --logfile FILE read commit message from file
-d --date DATErecord the specified date as commit date
-u --user USERrecord the specified user as committer
-   -D --current-date record the current date as commit date
-   -U --current-user record the current user as committer
+   -D --currentdate  record the current date as commit date
+   -U --currentuser  record the current user as committer
   
   (some details hidden, use --verbose to show complete help)
 
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -101,9 +101,9 @@
 ]
 
 commitopts3 = [
-(b'D', b'current-date', None,
+(b'D', b'currentdate', None,
  _(b'record the current date as commit date')),
-(b'U', b'current-user', None,
+(b'U', b'currentuser', None,
  _(b'record the current user as committer')),
 ]
 
@@ -186,9 +186,9 @@
 """modify commit options dict to handle related options
 """
 # N.B. this is extremely similar to setupheaderopts() in mq.py
-if not opts.get(b'date') and opts.get(b'current_date'):
+if not opts.get(b'date') and opts.get(b'currentdate'):
 opts[b'date'] = b'%d %d' % dateutil.makedate()
-if not opts.get(b'user') and opts.get(b'current_user'):
+if not opts.get(b'user') and opts.get(b'currentuser'):
 opts[b'user'] = ui.username()
 
 def ishunk(x):



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


D6832: highlight: fix encoding issues to enable Py3 compatibility

2019-09-11 Thread sheehan (Connor Sheehan)
Closed by commit rHGa7abc6081bc5: highlight: fix encoding issues to enable Py3 
compatibility (authored by sheehan).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6832?vs=16467&id=16514

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6832/new/

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

AFFECTED FILES
  contrib/python3-whitelist
  hgext/highlight/__init__.py
  hgext/highlight/highlight.py

CHANGE DETAILS

diff --git a/hgext/highlight/highlight.py b/hgext/highlight/highlight.py
--- a/hgext/highlight/highlight.py
+++ b/hgext/highlight/highlight.py
@@ -15,6 +15,7 @@
 
 from mercurial import (
 encoding,
+pycompat,
 )
 
 from mercurial.utils import (
@@ -61,11 +62,12 @@
 
 # Pygments is best used with Unicode strings:
 # 
-text = text.decode(encoding.encoding, 'replace')
+text = text.decode(pycompat.sysstr(encoding.encoding), 'replace')
 
 # To get multi-line strings right, we can't format line-by-line
 try:
-lexer = guess_lexer_for_filename(fctx.path(), text[:1024],
+path = pycompat.sysstr(fctx.path())
+lexer = guess_lexer_for_filename(path, text[:1024],
  stripnl=False)
 except (ClassNotFound, ValueError):
 # guess_lexer will return a lexer if *any* lexer matches. There is
@@ -84,10 +86,10 @@
 if isinstance(lexer, TextLexer):
 return
 
-formatter = HtmlFormatter(nowrap=True, style=style)
+formatter = HtmlFormatter(nowrap=True, style=pycompat.sysstr(style))
 
 colorized = highlight(text, lexer, formatter)
-coloriter = (s.encode(encoding.encoding, 'replace')
+coloriter = (s.encode(pycompat.sysstr(encoding.encoding), 'replace')
  for s in colorized.splitlines())
 
 tmpl._filters['colorize'] = lambda x: next(coloriter)
diff --git a/hgext/highlight/__init__.py b/hgext/highlight/__init__.py
--- a/hgext/highlight/__init__.py
+++ b/hgext/highlight/__init__.py
@@ -36,6 +36,7 @@
 
 from mercurial import (
 extensions,
+pycompat,
 )
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' 
for
@@ -79,11 +80,12 @@
 
 def generate_css(web):
 pg_style = web.config('web', 'pygments_style', 'colorful')
-fmter = highlight.HtmlFormatter(style=pg_style)
+fmter = highlight.HtmlFormatter(style=pycompat.sysstr(pg_style))
 web.res.headers['Content-Type'] = 'text/css'
+style_defs = fmter.get_style_defs(pycompat.sysstr(''))
 web.res.setbodybytes(''.join([
 '/* pygments_style = %s */\n\n' % pg_style,
-fmter.get_style_defs(''),
+pycompat.bytestr(style_defs),
 ]))
 return web.res.sendresponse()
 
diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -296,6 +296,7 @@
 test-hgwebdir-paths.py
 test-hgwebdir.t
 test-hgwebdirsym.t
+test-highlight.t
 test-histedit-arguments.t
 test-histedit-base.t
 test-histedit-bookmark-motion.t



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


D6840: hgweb: add a `message` attribute to `hgweb.common.ErrorResponse`

2019-09-11 Thread sheehan (Connor Sheehan)
Closed by commit rHG8d9322b6e687: hgweb: add a `message` attribute to 
`hgweb.common.ErrorResponse` (authored by sheehan).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6840?vs=16508&id=16513

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6840/new/

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

AFFECTED FILES
  mercurial/hgweb/common.py

CHANGE DETAILS

diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py
--- a/mercurial/hgweb/common.py
+++ b/mercurial/hgweb/common.py
@@ -106,6 +106,7 @@
 if headers is None:
 headers = []
 self.headers = headers
+self.message = message
 
 class continuereader(object):
 """File object wrapper to handle HTTP 100-continue.



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