D2995: bundleoperation: pass the source argument from all the users

2018-03-31 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf7d3915d5b3a: bundleoperation: pass the source argument 
from all the users (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2995?vs=7462&id=7472

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

AFFECTED FILES
  mercurial/bundle2.py
  mercurial/exchange.py

CHANGE DETAILS

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1595,7 +1595,8 @@
 _pullbundle2extraprepare(pullop, kwargs)
 bundle = pullop.remote.getbundle('pull', **pycompat.strkwargs(kwargs))
 try:
-op = bundle2.bundleoperation(pullop.repo, pullop.gettransaction)
+op = bundle2.bundleoperation(pullop.repo, pullop.gettransaction,
+ source='pull')
 op.modes['bookmarks'] = 'records'
 bundle2.processbundle(pullop.repo, bundle, op=op)
 except bundle2.AbortFromPart as exc:
@@ -2052,7 +2053,8 @@
 gettransaction()
 
 op = bundle2.bundleoperation(repo, gettransaction,
- captureoutput=captureoutput)
+ captureoutput=captureoutput,
+ source='push')
 try:
 op = bundle2.processbundle(repo, cg, op=op)
 finally:
diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -353,7 +353,7 @@
 return processbundle(repo, unbundler, lambda: tr, source=source)
 else:
 # the transactiongetter won't be used, but we might as well set it
-op = bundleoperation(repo, lambda: tr)
+op = bundleoperation(repo, lambda: tr, source=source)
 _processchangegroup(op, unbundler, tr, source, url, **kwargs)
 return op
 
@@ -441,7 +441,7 @@
 if op is None:
 if transactiongetter is None:
 transactiongetter = _notransaction
-op = bundleoperation(repo, transactiongetter)
+op = bundleoperation(repo, transactiongetter, source=source)
 # todo:
 # - replace this is a init function soon.
 # - exception catching



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


D2995: bundleoperation: pass the source argument from all the users

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

REVISION SUMMARY
  We now have a source attribute to the bundle2.bundleoperation class which 
stores
  the operation which leads to the current bundling/unbundling. Let's make sure 
we
  pass source argument from all the users of the command.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/bundle2.py
  mercurial/exchange.py

CHANGE DETAILS

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1595,7 +1595,8 @@
 _pullbundle2extraprepare(pullop, kwargs)
 bundle = pullop.remote.getbundle('pull', **pycompat.strkwargs(kwargs))
 try:
-op = bundle2.bundleoperation(pullop.repo, pullop.gettransaction)
+op = bundle2.bundleoperation(pullop.repo, pullop.gettransaction,
+ source='pull')
 op.modes['bookmarks'] = 'records'
 bundle2.processbundle(pullop.repo, bundle, op=op)
 except bundle2.AbortFromPart as exc:
@@ -2052,7 +2053,8 @@
 gettransaction()
 
 op = bundle2.bundleoperation(repo, gettransaction,
- captureoutput=captureoutput)
+ captureoutput=captureoutput,
+ source='push')
 try:
 op = bundle2.processbundle(repo, cg, op=op)
 finally:
diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py
--- a/mercurial/bundle2.py
+++ b/mercurial/bundle2.py
@@ -353,7 +353,7 @@
 return processbundle(repo, unbundler, lambda: tr, source=source)
 else:
 # the transactiongetter won't be used, but we might as well set it
-op = bundleoperation(repo, lambda: tr)
+op = bundleoperation(repo, lambda: tr, source=source)
 _processchangegroup(op, unbundler, tr, source, url, **kwargs)
 return op
 
@@ -441,7 +441,7 @@
 if op is None:
 if transactiongetter is None:
 transactiongetter = _notransaction
-op = bundleoperation(repo, transactiongetter)
+op = bundleoperation(repo, transactiongetter, source=source)
 # todo:
 # - replace this is a init function soon.
 # - exception catching



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