D2955: infinitpush: delete the non-forward-move flag for hg push
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Tue Mar 27 12:38:11 UTC 2018
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2955
AFFECTED FILES
hgext/infinitepush/__init__.py
hgext/infinitepush/bundleparts.py
tests/test-infinitepush-bundlestore.t
CHANGE DETAILS
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
@@ -303,14 +303,6 @@
$ hg push -r . -B scratch/mybranch
pushing to ssh://user@dummy/repo
searching for changes
- remote: non-forward push
- remote: (use --non-forward-move to override)
- abort: push failed on remote
- [255]
-
- $ hg push -r . -B scratch/mybranch --non-forward-move
- pushing to ssh://user@dummy/repo
- searching for changes
remote: pushing 5 commits:
remote: 20759b6926ce scratchcommit
remote: 1de1d7d92f89 new scratch commit
diff --git a/hgext/infinitepush/bundleparts.py b/hgext/infinitepush/bundleparts.py
--- a/hgext/infinitepush/bundleparts.py
+++ b/hgext/infinitepush/bundleparts.py
@@ -22,8 +22,7 @@
scratchbranchparttype = 'b2x:infinitepush'
-def getscratchbranchparts(repo, peer, outgoing, confignonforwardmove,
- ui, bookmark):
+def getscratchbranchparts(repo, peer, outgoing, ui, bookmark):
if not outgoing.missing:
raise error.Abort(_('no commits to push'))
@@ -49,8 +48,6 @@
params['bookprevnode'] = ''
if bookmark in repo:
params['bookprevnode'] = repo[bookmark].hex()
- if confignonforwardmove:
- params['force'] = '1'
# Do not send pushback bundle2 part with bookmarks if remotenames extension
# is enabled. It will be handled manually in `_push()`
diff --git a/hgext/infinitepush/__init__.py b/hgext/infinitepush/__init__.py
--- a/hgext/infinitepush/__init__.py
+++ b/hgext/infinitepush/__init__.py
@@ -165,14 +165,10 @@
configitem('experimental', 'infinitepush-scratchpush',
default=False,
)
-configitem('experimental', 'non-forward-move',
- default=False,
-)
experimental = 'experimental'
configbookmark = 'server-bundlestore-bookmark'
configscratchpush = 'infinitepush-scratchpush'
-confignonforwardmove = 'non-forward-move'
scratchbranchparttype = bundleparts.scratchbranchparttype
cmdtable = infinitepushcommands.cmdtable
@@ -303,11 +299,6 @@
def clientextsetup(ui):
entry = extensions.wrapcommand(commands.table, 'push', _push)
- if not any(a for a in entry[1] if a[1] == 'non-forward-move'):
- entry[1].append(('', 'non-forward-move', None,
- _('allows moving a remote bookmark to an '
- 'arbitrary place')))
-
entry[1].append(
('', 'bundle-store', None,
_('force push to go to bundle store (EXPERIMENTAL)')))
@@ -712,8 +703,6 @@
# containing `pushkey` part to update bookmarks)
ui.setconfig(experimental, 'bundle2.pushback', True)
- ui.setconfig(experimental, confignonforwardmove,
- opts.get('non_forward_move'), '--non-forward-move')
if scratchpush:
# this is an infinitepush, we don't want the bookmark to be applied
# rather that should be stored in the bundlestore
@@ -806,12 +795,9 @@
# code path.
bundler.addparam("infinitepush", "True")
- nonforwardmove = pushop.force or pushop.ui.configbool(experimental,
- confignonforwardmove)
scratchparts = bundleparts.getscratchbranchparts(pushop.repo,
pushop.remote,
pushop.outgoing,
- nonforwardmove,
pushop.ui,
bookmark)
@@ -838,12 +824,7 @@
if oldnode in bundle and list(bundle.set('bundle() & %s::', oldnode)):
return revs
- # Forced non-fast forward update
- if force:
- return revs
- else:
- raise error.Abort(_('non-forward push'),
- hint=_('use --non-forward-move to override'))
+ return revs
@contextlib.contextmanager
def logservicecall(logger, service, **kwargs):
To: pulkit, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list