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