D2107: infinitepush: drop the `--create` flag to push command

2018-03-30 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG78c2e9418278: infinitepush: drop the `--create` flag to 
push command (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2107?vs=5368=7423

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

AFFECTED FILES
  hgext/infinitepush/__init__.py
  hgext/infinitepush/bundleparts.py
  tests/test-infinitepush-bundlestore.t
  tests/test-infinitepush.t

CHANGE DETAILS

diff --git a/tests/test-infinitepush.t b/tests/test-infinitepush.t
--- a/tests/test-infinitepush.t
+++ b/tests/test-infinitepush.t
@@ -49,7 +49,7 @@
   $ hg ci -Am "scratchfirstpart"
   adding scratchfirstpart
   created new head
-  $ hg push -r . --to scratch/firstpart --create
+  $ hg push -r . --to scratch/firstpart
   pushing to ssh://user@dummy/repo
   searching for changes
   remote: pushing 1 commit:
@@ -60,7 +60,7 @@
   $ hg ci -Am "scratchsecondpart"
   adding scratchsecondpart
   created new head
-  $ hg push -r . --to scratch/secondpart --create
+  $ hg push -r . --to scratch/secondpart
   pushing to ssh://user@dummy/repo
   searching for changes
   remote: pushing 1 commit:
@@ -96,7 +96,7 @@
   $ hg log -r '.' -T '{node}\n' > ../testpullbycommithash1
   $ echo testpullbycommithash2 > testpullbycommithash2
   $ hg ci -Aqm "testpullbycommithash2"
-  $ hg push -r . --to scratch/mybranch --create -q
+  $ hg push -r . --to scratch/mybranch -q
 
 Create third client and pull by commit hash.
 Make sure testpullbycommithash2 has not fetched
@@ -144,7 +144,7 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ echo scratchontopofpublic > scratchontopofpublic
   $ hg ci -Aqm "scratchontopofpublic"
-  $ hg push -r . --to scratch/scratchontopofpublic --create
+  $ hg push -r . --to scratch/scratchontopofpublic
   pushing to ssh://user@dummy/repo
   searching for changes
   remote: pushing 1 commit:
@@ -300,7 +300,7 @@
   $ hg ci -Aqm "tofillmetadata"
   $ hg log -r . -T '{node}\n'
   d2b0410d4da084bc534b1d90df0de9eb21583496
-  $ hg push -r . --to scratch/fillmetadata/fill --create
+  $ hg push -r . --to scratch/fillmetadata/fill
   pushing to ssh://user@dummy/repo
   searching for changes
   remote: pushing 6 commits:
diff --git a/tests/test-infinitepush-bundlestore.t 
b/tests/test-infinitepush-bundlestore.t
--- a/tests/test-infinitepush-bundlestore.t
+++ b/tests/test-infinitepush-bundlestore.t
@@ -18,15 +18,15 @@
   $ hg clone ssh://user@dummy/repo client -q
   $ cd client
   $ mkcommit initialcommit
-  $ hg push -r . --create
+  $ hg push -r .
   pushing to ssh://user@dummy/repo
   searching for changes
   remote: adding changesets
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
   $ mkcommit scratchcommit
-  $ hg push -r . --to scratch/mybranch --create
+  $ hg push -r . --to scratch/mybranch
   pushing to ssh://user@dummy/repo
   searching for changes
   remote: pushing 1 commit:
@@ -140,7 +140,7 @@
   scratch/mybranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
 
 Push scratch bookmark with no new revs
-  $ hg push -r . --to scratch/anotherbranch --create
+  $ hg push -r . --to scratch/anotherbranch
   pushing to ssh://user@dummy/repo
   searching for changes
   remote: pushing 2 commits:
diff --git a/hgext/infinitepush/bundleparts.py 
b/hgext/infinitepush/bundleparts.py
--- a/hgext/infinitepush/bundleparts.py
+++ b/hgext/infinitepush/bundleparts.py
@@ -23,7 +23,7 @@
 scratchbranchparttype = 'b2x:infinitepush'
 
 def getscratchbranchparts(repo, peer, outgoing, confignonforwardmove,
- ui, bookmark, create):
+  ui, bookmark):
 if not outgoing.missing:
 raise error.Abort(_('no commits to push'))
 
@@ -49,8 +49,6 @@
 params['bookprevnode'] = ''
 if bookmark in repo:
 params['bookprevnode'] = repo[bookmark].hex()
-if create:
-params['create'] = '1'
 if confignonforwardmove:
 params['force'] = '1'
 
diff --git a/hgext/infinitepush/__init__.py b/hgext/infinitepush/__init__.py
--- a/hgext/infinitepush/__init__.py
+++ b/hgext/infinitepush/__init__.py
@@ -175,9 +175,6 @@
 configitem('experimental', 'server-bundlestore-bookmark',
 default='',
 )
-configitem('experimental', 'server-bundlestore-create',
-default='',
-)
 configitem('experimental', 'infinitepush-scratchpush',
 default=False,
 )
@@ -187,7 +184,6 @@
 
 experimental = 'experimental'
 configbookmark = 'server-bundlestore-bookmark'
-configcreate = 'server-bundlestore-create'
 configscratchpush = 'infinitepush-scratchpush'
 confignonforwardmove = 'non-forward-move'
 
@@ -328,10 +324,6 @@
  _('allows moving a remote bookmark to an '
'arbitrary place')))
 
-if not any(a for a in entry[1] if a[1] == 'create'):
-entry[1].append(
-('', 

D2107: infinitepush: drop the `--create` flag to push command

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

REVISION SUMMARY
  The extension added a `--create` flag for creating a new bookmark on the
  bundlestore. This patch changes the bahviour to create a bookmark if it does 
not
  exists and removes the requirement of the `--create` and then drop the logic
  around the `--create` flag.
  
  Tests are changed to drop the usage of `--create` flag.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/infinitepush/__init__.py
  hgext/infinitepush/bundleparts.py
  tests/test-infinitepush-bundlestore.t
  tests/test-infinitepush.t

CHANGE DETAILS

diff --git a/tests/test-infinitepush.t b/tests/test-infinitepush.t
--- a/tests/test-infinitepush.t
+++ b/tests/test-infinitepush.t
@@ -49,7 +49,7 @@
   $ hg ci -Am "scratchfirstpart"
   adding scratchfirstpart
   created new head
-  $ hg push -r . --to scratch/firstpart --create
+  $ hg push -r . --to scratch/firstpart
   pushing to ssh://user@dummy/repo
   searching for changes
   remote: pushing 1 commit:
@@ -60,7 +60,7 @@
   $ hg ci -Am "scratchsecondpart"
   adding scratchsecondpart
   created new head
-  $ hg push -r . --to scratch/secondpart --create
+  $ hg push -r . --to scratch/secondpart
   pushing to ssh://user@dummy/repo
   searching for changes
   remote: pushing 1 commit:
@@ -96,7 +96,7 @@
   $ hg log -r '.' -T '{node}\n' > ../testpullbycommithash1
   $ echo testpullbycommithash2 > testpullbycommithash2
   $ hg ci -Aqm "testpullbycommithash2"
-  $ hg push -r . --to scratch/mybranch --create -q
+  $ hg push -r . --to scratch/mybranch -q
 
 Create third client and pull by commit hash.
 Make sure testpullbycommithash2 has not fetched
@@ -144,7 +144,7 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ echo scratchontopofpublic > scratchontopofpublic
   $ hg ci -Aqm "scratchontopofpublic"
-  $ hg push -r . --to scratch/scratchontopofpublic --create
+  $ hg push -r . --to scratch/scratchontopofpublic
   pushing to ssh://user@dummy/repo
   searching for changes
   remote: pushing 1 commit:
@@ -300,7 +300,7 @@
   $ hg ci -Aqm "tofillmetadata"
   $ hg log -r . -T '{node}\n'
   d2b0410d4da084bc534b1d90df0de9eb21583496
-  $ hg push -r . --to scratch/fillmetadata/fill --create
+  $ hg push -r . --to scratch/fillmetadata/fill
   pushing to ssh://user@dummy/repo
   searching for changes
   remote: pushing 6 commits:
diff --git a/tests/test-infinitepush-bundlestore.t 
b/tests/test-infinitepush-bundlestore.t
--- a/tests/test-infinitepush-bundlestore.t
+++ b/tests/test-infinitepush-bundlestore.t
@@ -18,15 +18,15 @@
   $ hg clone ssh://user@dummy/repo client -q
   $ cd client
   $ mkcommit initialcommit
-  $ hg push -r . --create
+  $ hg push -r .
   pushing to ssh://user@dummy/repo
   searching for changes
   remote: adding changesets
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
   $ mkcommit scratchcommit
-  $ hg push -r . --to scratch/mybranch --create
+  $ hg push -r . --to scratch/mybranch
   pushing to ssh://user@dummy/repo
   searching for changes
   remote: pushing 1 commit:
@@ -140,7 +140,7 @@
   scratch/mybranch 1de1d7d92f8965260391d0513fe8a8d5973d3042
 
 Push scratch bookmark with no new revs
-  $ hg push -r . --to scratch/anotherbranch --create
+  $ hg push -r . --to scratch/anotherbranch
   pushing to ssh://user@dummy/repo
   searching for changes
   remote: pushing 2 commits:
diff --git a/hgext/infinitepush/bundleparts.py 
b/hgext/infinitepush/bundleparts.py
--- a/hgext/infinitepush/bundleparts.py
+++ b/hgext/infinitepush/bundleparts.py
@@ -23,7 +23,7 @@
 scratchbranchparttype = 'b2x:infinitepush'
 
 def getscratchbranchparts(repo, peer, outgoing, confignonforwardmove,
- ui, bookmark, create):
+  ui, bookmark):
 if not outgoing.missing:
 raise error.Abort(_('no commits to push'))
 
@@ -49,8 +49,6 @@
 params['bookprevnode'] = ''
 if bookmark in repo:
 params['bookprevnode'] = repo[bookmark].hex()
-if create:
-params['create'] = '1'
 if confignonforwardmove:
 params['force'] = '1'
 
diff --git a/hgext/infinitepush/__init__.py b/hgext/infinitepush/__init__.py
--- a/hgext/infinitepush/__init__.py
+++ b/hgext/infinitepush/__init__.py
@@ -175,9 +175,6 @@
 configitem('experimental', 'server-bundlestore-bookmark',
 default='',
 )
-configitem('experimental', 'server-bundlestore-create',
-default='',
-)
 configitem('experimental', 'infinitepush-scratchpush',
 default=False,
 )
@@ -187,7 +184,6 @@
 
 experimental = 'experimental'
 configbookmark = 'server-bundlestore-bookmark'
-configcreate = 'server-bundlestore-create'
 configscratchpush = 'infinitepush-scratchpush'
 confignonforwardmove = 'non-forward-move'
 
@@ -328,10 +324,6 @@
  _('allows moving a