##// END OF EJS Templates
localrepo: refactor prepushoutgoinghook to take a pushop...
Mads Kiilerich -
r28876:79b8f052 default
parent child Browse files
Show More
@@ -352,12 +352,13 b' def reposetup(ui, repo):'
352 352 # is used to write status out.
353 353 repo._lfstatuswriters = [ui.status]
354 354
355 def prepushoutgoinghook(local, remote, outgoing):
356 if outgoing.missing:
355 def prepushoutgoinghook(pushop):
356 if pushop.outgoing.missing:
357 357 toupload = set()
358 358 addfunc = lambda fn, lfhash: toupload.add(lfhash)
359 lfutil.getlfilestoupload(local, outgoing.missing, addfunc)
360 lfcommands.uploadlfiles(ui, local, remote, toupload)
359 lfutil.getlfilestoupload(pushop.repo, pushop.outgoing.missing,
360 addfunc)
361 lfcommands.uploadlfiles(ui, pushop.repo, pushop.remote, toupload)
361 362 repo.prepushoutgoinghooks.add("largefiles", prepushoutgoinghook)
362 363
363 364 def checkrequireslfiles(ui, repo, **kwargs):
@@ -694,9 +694,7 b' def _pushb2ctx(pushop, bundler):'
694 694 # Send known heads to the server for race detection.
695 695 if not _pushcheckoutgoing(pushop):
696 696 return
697 pushop.repo.prepushoutgoinghooks(pushop.repo,
698 pushop.remote,
699 pushop.outgoing)
697 pushop.repo.prepushoutgoinghooks(pushop)
700 698
701 699 _pushb2ctxcheckheads(pushop, bundler)
702 700
@@ -884,9 +882,7 b' def _pushchangeset(pushop):'
884 882 pushop.stepsdone.add('changesets')
885 883 if not _pushcheckoutgoing(pushop):
886 884 return
887 pushop.repo.prepushoutgoinghooks(pushop.repo,
888 pushop.remote,
889 pushop.outgoing)
885 pushop.repo.prepushoutgoinghooks(pushop)
890 886 outgoing = pushop.outgoing
891 887 unbundle = pushop.remote.capable('unbundle')
892 888 # TODO: get bundlecaps from remote
@@ -1887,8 +1887,8 b' class localrepository(object):'
1887 1887
1888 1888 @unfilteredpropertycache
1889 1889 def prepushoutgoinghooks(self):
1890 """Return util.hooks consists of "(repo, remote, outgoing)"
1891 functions, which are called before pushing changesets.
1890 """Return util.hooks consists of a pushop with repo, remote, outgoing
1891 methods, which are called before pushing changesets.
1892 1892 """
1893 1893 return util.hooks()
1894 1894
General Comments 0
You need to be logged in to leave comments. Login now