Show More
@@ -704,6 +704,7 def _pull(orig, ui, repo, source=b"defau | |||||
704 |
|
704 | |||
705 | if scratchbookmarks: |
|
705 | if scratchbookmarks: | |
706 | other = hg.peer(repo, opts, source) |
|
706 | other = hg.peer(repo, opts, source) | |
|
707 | try: | |||
707 | fetchedbookmarks = other.listkeyspatterns( |
|
708 | fetchedbookmarks = other.listkeyspatterns( | |
708 | b'bookmarks', patterns=scratchbookmarks |
|
709 | b'bookmarks', patterns=scratchbookmarks | |
709 | ) |
|
710 | ) | |
@@ -714,6 +715,8 def _pull(orig, ui, repo, source=b"defau | |||||
714 | ) |
|
715 | ) | |
715 | scratchbookmarks[bookmark] = fetchedbookmarks[bookmark] |
|
716 | scratchbookmarks[bookmark] = fetchedbookmarks[bookmark] | |
716 | revs.append(fetchedbookmarks[bookmark]) |
|
717 | revs.append(fetchedbookmarks[bookmark]) | |
|
718 | finally: | |||
|
719 | other.close() | |||
717 | opts[b'bookmark'] = bookmarks |
|
720 | opts[b'bookmark'] = bookmarks | |
718 | opts[b'rev'] = revs |
|
721 | opts[b'rev'] = revs | |
719 |
|
722 | |||
@@ -848,10 +851,13 def _push(orig, ui, repo, dest=None, *ar | |||||
848 | if common.isremotebooksenabled(ui): |
|
851 | if common.isremotebooksenabled(ui): | |
849 | if bookmark and scratchpush: |
|
852 | if bookmark and scratchpush: | |
850 | other = hg.peer(repo, opts, destpath) |
|
853 | other = hg.peer(repo, opts, destpath) | |
|
854 | try: | |||
851 | fetchedbookmarks = other.listkeyspatterns( |
|
855 | fetchedbookmarks = other.listkeyspatterns( | |
852 | b'bookmarks', patterns=[bookmark] |
|
856 | b'bookmarks', patterns=[bookmark] | |
853 | ) |
|
857 | ) | |
854 | remotescratchbookmarks.update(fetchedbookmarks) |
|
858 | remotescratchbookmarks.update(fetchedbookmarks) | |
|
859 | finally: | |||
|
860 | other.close() | |||
855 | _saveremotebookmarks(repo, remotescratchbookmarks, destpath) |
|
861 | _saveremotebookmarks(repo, remotescratchbookmarks, destpath) | |
856 | if oldphasemove: |
|
862 | if oldphasemove: | |
857 | exchange._localphasemove = oldphasemove |
|
863 | exchange._localphasemove = oldphasemove |
@@ -595,10 +595,14 def trackedcmd(ui, repo, remotepath=None | |||||
595 | ui.status(_(b'comparing with %s\n') % util.hidepassword(url)) |
|
595 | ui.status(_(b'comparing with %s\n') % util.hidepassword(url)) | |
596 | remote = hg.peer(repo, opts, url) |
|
596 | remote = hg.peer(repo, opts, url) | |
597 |
|
597 | |||
|
598 | try: | |||
598 | # check narrow support before doing anything if widening needs to be |
|
599 | # check narrow support before doing anything if widening needs to be | |
599 | # performed. In future we should also abort if client is ellipses and |
|
600 | # performed. In future we should also abort if client is ellipses and | |
600 | # server does not support ellipses |
|
601 | # server does not support ellipses | |
601 | if widening and wireprototypes.NARROWCAP not in remote.capabilities(): |
|
602 | if ( | |
|
603 | widening | |||
|
604 | and wireprototypes.NARROWCAP not in remote.capabilities() | |||
|
605 | ): | |||
602 | raise error.Abort(_(b"server does not support narrow clones")) |
|
606 | raise error.Abort(_(b"server does not support narrow clones")) | |
603 |
|
607 | |||
604 | commoninc = discovery.findcommonincoming(repo, remote) |
|
608 | commoninc = discovery.findcommonincoming(repo, remote) | |
@@ -667,5 +671,7 def trackedcmd(ui, repo, remotepath=None | |||||
667 | newincludes, |
|
671 | newincludes, | |
668 | newexcludes, |
|
672 | newexcludes, | |
669 | ) |
|
673 | ) | |
|
674 | finally: | |||
|
675 | remote.close() | |||
670 |
|
676 | |||
671 | return 0 |
|
677 | return 0 |
@@ -3820,9 +3820,12 def identify( | |||||
3820 | output = [] |
|
3820 | output = [] | |
3821 | revs = [] |
|
3821 | revs = [] | |
3822 |
|
3822 | |||
|
3823 | peer = None | |||
|
3824 | try: | |||
3823 | if source: |
|
3825 | if source: | |
3824 | source, branches = hg.parseurl(ui.expandpath(source)) |
|
3826 | source, branches = hg.parseurl(ui.expandpath(source)) | |
3825 |
|
|
3827 | # only pass ui when no repo | |
|
3828 | peer = hg.peer(repo or ui, opts, source) | |||
3826 | repo = peer.local() |
|
3829 | repo = peer.local() | |
3827 | revs, checkout = hg.addbranchrevs(repo, peer, branches, None) |
|
3830 | revs, checkout = hg.addbranchrevs(repo, peer, branches, None) | |
3828 |
|
3831 | |||
@@ -3946,6 +3949,9 def identify( | |||||
3946 |
|
3949 | |||
3947 | fm.plain(b"%s\n" % b' '.join(output)) |
|
3950 | fm.plain(b"%s\n" % b' '.join(output)) | |
3948 | fm.end() |
|
3951 | fm.end() | |
|
3952 | finally: | |||
|
3953 | if peer: | |||
|
3954 | peer.close() | |||
3949 |
|
3955 | |||
3950 |
|
3956 | |||
3951 | @command( |
|
3957 | @command( | |
@@ -4291,12 +4297,15 def incoming(ui, repo, source=b"default" | |||||
4291 | ui.expandpath(source), opts.get(b'branch') |
|
4297 | ui.expandpath(source), opts.get(b'branch') | |
4292 | ) |
|
4298 | ) | |
4293 | other = hg.peer(repo, opts, source) |
|
4299 | other = hg.peer(repo, opts, source) | |
|
4300 | try: | |||
4294 | if b'bookmarks' not in other.listkeys(b'namespaces'): |
|
4301 | if b'bookmarks' not in other.listkeys(b'namespaces'): | |
4295 | ui.warn(_(b"remote doesn't support bookmarks\n")) |
|
4302 | ui.warn(_(b"remote doesn't support bookmarks\n")) | |
4296 | return 0 |
|
4303 | return 0 | |
4297 | ui.pager(b'incoming') |
|
4304 | ui.pager(b'incoming') | |
4298 | ui.status(_(b'comparing with %s\n') % util.hidepassword(source)) |
|
4305 | ui.status(_(b'comparing with %s\n') % util.hidepassword(source)) | |
4299 | return bookmarks.incoming(ui, repo, other) |
|
4306 | return bookmarks.incoming(ui, repo, other) | |
|
4307 | finally: | |||
|
4308 | other.close() | |||
4300 |
|
4309 | |||
4301 | repo._subtoppath = ui.expandpath(source) |
|
4310 | repo._subtoppath = ui.expandpath(source) | |
4302 | try: |
|
4311 | try: | |
@@ -4327,7 +4336,8 def init(ui, dest=b".", **opts): | |||||
4327 | Returns 0 on success. |
|
4336 | Returns 0 on success. | |
4328 | """ |
|
4337 | """ | |
4329 | opts = pycompat.byteskwargs(opts) |
|
4338 | opts = pycompat.byteskwargs(opts) | |
4330 | hg.peer(ui, opts, ui.expandpath(dest), create=True) |
|
4339 | peer = hg.peer(ui, opts, ui.expandpath(dest), create=True) | |
|
4340 | peer.close() | |||
4331 |
|
4341 | |||
4332 |
|
4342 | |||
4333 | @command( |
|
4343 | @command( | |
@@ -4963,12 +4973,15 def outgoing(ui, repo, dest=None, **opts | |||||
4963 | if opts.get(b'bookmarks'): |
|
4973 | if opts.get(b'bookmarks'): | |
4964 | dest = path.pushloc or path.loc |
|
4974 | dest = path.pushloc or path.loc | |
4965 | other = hg.peer(repo, opts, dest) |
|
4975 | other = hg.peer(repo, opts, dest) | |
|
4976 | try: | |||
4966 | if b'bookmarks' not in other.listkeys(b'namespaces'): |
|
4977 | if b'bookmarks' not in other.listkeys(b'namespaces'): | |
4967 | ui.warn(_(b"remote doesn't support bookmarks\n")) |
|
4978 | ui.warn(_(b"remote doesn't support bookmarks\n")) | |
4968 | return 0 |
|
4979 | return 0 | |
4969 | ui.status(_(b'comparing with %s\n') % util.hidepassword(dest)) |
|
4980 | ui.status(_(b'comparing with %s\n') % util.hidepassword(dest)) | |
4970 | ui.pager(b'outgoing') |
|
4981 | ui.pager(b'outgoing') | |
4971 | return bookmarks.outgoing(ui, repo, other) |
|
4982 | return bookmarks.outgoing(ui, repo, other) | |
|
4983 | finally: | |||
|
4984 | other.close() | |||
4972 |
|
4985 | |||
4973 | repo._subtoppath = path.pushloc or path.loc |
|
4986 | repo._subtoppath = path.pushloc or path.loc | |
4974 | try: |
|
4987 | try: | |
@@ -5679,6 +5692,7 def push(ui, repo, dest=None, **opts): | |||||
5679 | revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get(b'rev')) |
|
5692 | revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get(b'rev')) | |
5680 | other = hg.peer(repo, opts, dest) |
|
5693 | other = hg.peer(repo, opts, dest) | |
5681 |
|
5694 | |||
|
5695 | try: | |||
5682 | if revs: |
|
5696 | if revs: | |
5683 | revs = [repo[r].node() for r in scmutil.revrange(repo, revs)] |
|
5697 | revs = [repo[r].node() for r in scmutil.revrange(repo, revs)] | |
5684 | if not revs: |
|
5698 | if not revs: | |
@@ -5714,7 +5728,9 def push(ui, repo, dest=None, **opts): | |||||
5714 | finally: |
|
5728 | finally: | |
5715 | del repo._subtoppath |
|
5729 | del repo._subtoppath | |
5716 |
|
5730 | |||
5717 | opargs = dict(opts.get(b'opargs', {})) # copy opargs since we may mutate it |
|
5731 | opargs = dict( | |
|
5732 | opts.get(b'opargs', {}) | |||
|
5733 | ) # copy opargs since we may mutate it | |||
5718 | opargs.setdefault(b'pushvars', []).extend(opts.get(b'pushvars', [])) |
|
5734 | opargs.setdefault(b'pushvars', []).extend(opts.get(b'pushvars', [])) | |
5719 |
|
5735 | |||
5720 | pushop = exchange.push( |
|
5736 | pushop = exchange.push( | |
@@ -5735,7 +5751,8 def push(ui, repo, dest=None, **opts): | |||||
5735 | result = 2 |
|
5751 | result = 2 | |
5736 | elif not result and pushop.bkresult: |
|
5752 | elif not result and pushop.bkresult: | |
5737 | result = 2 |
|
5753 | result = 2 | |
5738 |
|
5754 | finally: | ||
|
5755 | other.close() | |||
5739 | return result |
|
5756 | return result | |
5740 |
|
5757 | |||
5741 |
|
5758 |
@@ -471,6 +471,7 def debugcapabilities(ui, path, **opts): | |||||
471 | """lists the capabilities of a remote peer""" |
|
471 | """lists the capabilities of a remote peer""" | |
472 | opts = pycompat.byteskwargs(opts) |
|
472 | opts = pycompat.byteskwargs(opts) | |
473 | peer = hg.peer(ui, opts, path) |
|
473 | peer = hg.peer(ui, opts, path) | |
|
474 | try: | |||
474 | caps = peer.capabilities() |
|
475 | caps = peer.capabilities() | |
475 | ui.writenoi18n(b'Main capabilities:\n') |
|
476 | ui.writenoi18n(b'Main capabilities:\n') | |
476 | for c in sorted(caps): |
|
477 | for c in sorted(caps): | |
@@ -482,6 +483,8 def debugcapabilities(ui, path, **opts): | |||||
482 | ui.write(b' %s\n' % key) |
|
483 | ui.write(b' %s\n' % key) | |
483 | for v in values: |
|
484 | for v in values: | |
484 | ui.write(b' %s\n' % v) |
|
485 | ui.write(b' %s\n' % v) | |
|
486 | finally: | |||
|
487 | peer.close() | |||
485 |
|
488 | |||
486 |
|
489 | |||
487 | @command( |
|
490 | @command( | |
@@ -2615,12 +2618,17 def debugpeer(ui, path): | |||||
2615 | with ui.configoverride(overrides): |
|
2618 | with ui.configoverride(overrides): | |
2616 | peer = hg.peer(ui, {}, path) |
|
2619 | peer = hg.peer(ui, {}, path) | |
2617 |
|
2620 | |||
|
2621 | try: | |||
2618 | local = peer.local() is not None |
|
2622 | local = peer.local() is not None | |
2619 | canpush = peer.canpush() |
|
2623 | canpush = peer.canpush() | |
2620 |
|
2624 | |||
2621 | ui.write(_(b'url: %s\n') % peer.url()) |
|
2625 | ui.write(_(b'url: %s\n') % peer.url()) | |
2622 | ui.write(_(b'local: %s\n') % (_(b'yes') if local else _(b'no'))) |
|
2626 | ui.write(_(b'local: %s\n') % (_(b'yes') if local else _(b'no'))) | |
2623 | ui.write(_(b'pushable: %s\n') % (_(b'yes') if canpush else _(b'no'))) |
|
2627 | ui.write( | |
|
2628 | _(b'pushable: %s\n') % (_(b'yes') if canpush else _(b'no')) | |||
|
2629 | ) | |||
|
2630 | finally: | |||
|
2631 | peer.close() | |||
2624 |
|
2632 | |||
2625 |
|
2633 | |||
2626 | @command( |
|
2634 | @command( | |
@@ -2723,6 +2731,7 def debugpushkey(ui, repopath, namespace | |||||
2723 | """ |
|
2731 | """ | |
2724 |
|
2732 | |||
2725 | target = hg.peer(ui, {}, repopath) |
|
2733 | target = hg.peer(ui, {}, repopath) | |
|
2734 | try: | |||
2726 | if keyinfo: |
|
2735 | if keyinfo: | |
2727 | key, old, new = keyinfo |
|
2736 | key, old, new = keyinfo | |
2728 | with target.commandexecutor() as e: |
|
2737 | with target.commandexecutor() as e: | |
@@ -2741,8 +2750,11 def debugpushkey(ui, repopath, namespace | |||||
2741 | else: |
|
2750 | else: | |
2742 | for k, v in sorted(pycompat.iteritems(target.listkeys(namespace))): |
|
2751 | for k, v in sorted(pycompat.iteritems(target.listkeys(namespace))): | |
2743 | ui.write( |
|
2752 | ui.write( | |
2744 | b"%s\t%s\n" % (stringutil.escapestr(k), stringutil.escapestr(v)) |
|
2753 | b"%s\t%s\n" | |
2745 | ) |
|
2754 | % (stringutil.escapestr(k), stringutil.escapestr(v)) | |
|
2755 | ) | |||
|
2756 | finally: | |||
|
2757 | target.close() | |||
2746 |
|
2758 | |||
2747 |
|
2759 | |||
2748 | @command(b'debugpvec', [], _(b'A B')) |
|
2760 | @command(b'debugpvec', [], _(b'A B')) | |
@@ -4095,6 +4107,7 def debugwhyunstable(ui, repo, rev): | |||||
4095 | def debugwireargs(ui, repopath, *vals, **opts): |
|
4107 | def debugwireargs(ui, repopath, *vals, **opts): | |
4096 | opts = pycompat.byteskwargs(opts) |
|
4108 | opts = pycompat.byteskwargs(opts) | |
4097 | repo = hg.peer(ui, opts, repopath) |
|
4109 | repo = hg.peer(ui, opts, repopath) | |
|
4110 | try: | |||
4098 | for opt in cmdutil.remoteopts: |
|
4111 | for opt in cmdutil.remoteopts: | |
4099 | del opts[opt[1]] |
|
4112 | del opts[opt[1]] | |
4100 | args = {} |
|
4113 | args = {} | |
@@ -4108,6 +4121,8 def debugwireargs(ui, repopath, *vals, * | |||||
4108 | ui.write(b"%s\n" % res1) |
|
4121 | ui.write(b"%s\n" % res1) | |
4109 | if res1 != res2: |
|
4122 | if res1 != res2: | |
4110 | ui.warn(b"%s\n" % res2) |
|
4123 | ui.warn(b"%s\n" % res2) | |
|
4124 | finally: | |||
|
4125 | repo.close() | |||
4111 |
|
4126 | |||
4112 |
|
4127 | |||
4113 | def _parsewirelangblocks(fh): |
|
4128 | def _parsewirelangblocks(fh): |
@@ -678,6 +678,9 def clone( | |||||
678 | srcpeer = source.peer() # in case we were called with a localrepo |
|
678 | srcpeer = source.peer() # in case we were called with a localrepo | |
679 | branches = (None, branch or []) |
|
679 | branches = (None, branch or []) | |
680 | origsource = source = srcpeer.url() |
|
680 | origsource = source = srcpeer.url() | |
|
681 | srclock = destlock = cleandir = None | |||
|
682 | destpeer = None | |||
|
683 | try: | |||
681 | revs, checkout = addbranchrevs(srcpeer, srcpeer, branches, revs) |
|
684 | revs, checkout = addbranchrevs(srcpeer, srcpeer, branches, revs) | |
682 |
|
685 | |||
683 | if dest is None: |
|
686 | if dest is None: | |
@@ -696,9 +699,13 def clone( | |||||
696 | destvfs = vfsmod.vfs(dest, expandpath=True) |
|
699 | destvfs = vfsmod.vfs(dest, expandpath=True) | |
697 | if destvfs.lexists(): |
|
700 | if destvfs.lexists(): | |
698 | if not destvfs.isdir(): |
|
701 | if not destvfs.isdir(): | |
699 | raise error.InputError(_(b"destination '%s' already exists") % dest) |
|
702 | raise error.InputError( | |
|
703 | _(b"destination '%s' already exists") % dest | |||
|
704 | ) | |||
700 | elif destvfs.listdir(): |
|
705 | elif destvfs.listdir(): | |
701 | raise error.InputError(_(b"destination '%s' is not empty") % dest) |
|
706 | raise error.InputError( | |
|
707 | _(b"destination '%s' is not empty") % dest | |||
|
708 | ) | |||
702 |
|
709 | |||
703 | createopts = {} |
|
710 | createopts = {} | |
704 | narrow = False |
|
711 | narrow = False | |
@@ -792,7 +799,9 def clone( | |||||
792 |
|
799 | |||
793 | # TODO this is a somewhat arbitrary restriction. |
|
800 | # TODO this is a somewhat arbitrary restriction. | |
794 | if narrow: |
|
801 | if narrow: | |
795 | ui.status(_(b'(pooled storage not supported for narrow clones)\n')) |
|
802 | ui.status( | |
|
803 | _(b'(pooled storage not supported for narrow clones)\n') | |||
|
804 | ) | |||
796 | sharepath = None |
|
805 | sharepath = None | |
797 |
|
806 | |||
798 | if sharepath: |
|
807 | if sharepath: | |
@@ -809,9 +818,8 def clone( | |||||
809 | stream=stream, |
|
818 | stream=stream, | |
810 | ) |
|
819 | ) | |
811 |
|
820 | |||
812 | srclock = destlock = cleandir = None |
|
|||
813 | srcrepo = srcpeer.local() |
|
821 | srcrepo = srcpeer.local() | |
814 | try: |
|
822 | ||
815 | abspath = origsource |
|
823 | abspath = origsource | |
816 | if islocal(origsource): |
|
824 | if islocal(origsource): | |
817 | abspath = os.path.abspath(util.urllocalpath(origsource)) |
|
825 | abspath = os.path.abspath(util.urllocalpath(origsource)) | |
@@ -1052,6 +1060,8 def clone( | |||||
1052 | shutil.rmtree(cleandir, True) |
|
1060 | shutil.rmtree(cleandir, True) | |
1053 | if srcpeer is not None: |
|
1061 | if srcpeer is not None: | |
1054 | srcpeer.close() |
|
1062 | srcpeer.close() | |
|
1063 | if destpeer and destpeer.local() is None: | |||
|
1064 | destpeer.close() | |||
1055 | return srcpeer, destpeer |
|
1065 | return srcpeer, destpeer | |
1056 |
|
1066 | |||
1057 |
|
1067 | |||
@@ -1253,6 +1263,8 def _incoming( | |||||
1253 | """ |
|
1263 | """ | |
1254 | source, branches = parseurl(ui.expandpath(source), opts.get(b'branch')) |
|
1264 | source, branches = parseurl(ui.expandpath(source), opts.get(b'branch')) | |
1255 | other = peer(repo, opts, source) |
|
1265 | other = peer(repo, opts, source) | |
|
1266 | cleanupfn = other.close | |||
|
1267 | try: | |||
1256 | ui.status(_(b'comparing with %s\n') % util.hidepassword(source)) |
|
1268 | ui.status(_(b'comparing with %s\n') % util.hidepassword(source)) | |
1257 | revs, checkout = addbranchrevs(repo, other, branches, opts.get(b'rev')) |
|
1269 | revs, checkout = addbranchrevs(repo, other, branches, opts.get(b'rev')) | |
1258 |
|
1270 | |||
@@ -1261,7 +1273,7 def _incoming( | |||||
1261 | other, chlist, cleanupfn = bundlerepo.getremotechanges( |
|
1273 | other, chlist, cleanupfn = bundlerepo.getremotechanges( | |
1262 | ui, repo, other, revs, opts[b"bundle"], opts[b"force"] |
|
1274 | ui, repo, other, revs, opts[b"bundle"], opts[b"force"] | |
1263 | ) |
|
1275 | ) | |
1264 | try: |
|
1276 | ||
1265 | if not chlist: |
|
1277 | if not chlist: | |
1266 | ui.status(_(b"no changes found\n")) |
|
1278 | ui.status(_(b"no changes found\n")) | |
1267 | return subreporecurse() |
|
1279 | return subreporecurse() | |
@@ -1320,6 +1332,7 def _outgoing(ui, repo, dest, opts): | |||||
1320 | revs = [repo[rev].node() for rev in scmutil.revrange(repo, revs)] |
|
1332 | revs = [repo[rev].node() for rev in scmutil.revrange(repo, revs)] | |
1321 |
|
1333 | |||
1322 | other = peer(repo, opts, dest) |
|
1334 | other = peer(repo, opts, dest) | |
|
1335 | try: | |||
1323 | outgoing = discovery.findcommonoutgoing( |
|
1336 | outgoing = discovery.findcommonoutgoing( | |
1324 | repo, other, revs, force=opts.get(b'force') |
|
1337 | repo, other, revs, force=opts.get(b'force') | |
1325 | ) |
|
1338 | ) | |
@@ -1327,6 +1340,9 def _outgoing(ui, repo, dest, opts): | |||||
1327 | if not o: |
|
1340 | if not o: | |
1328 | scmutil.nochangesfound(repo.ui, repo, outgoing.excluded) |
|
1341 | scmutil.nochangesfound(repo.ui, repo, outgoing.excluded) | |
1329 | return o, other |
|
1342 | return o, other | |
|
1343 | except: # re-raises | |||
|
1344 | other.close() | |||
|
1345 | raise | |||
1330 |
|
1346 | |||
1331 |
|
1347 | |||
1332 | def outgoing(ui, repo, dest, opts): |
|
1348 | def outgoing(ui, repo, dest, opts): | |
@@ -1341,6 +1357,7 def outgoing(ui, repo, dest, opts): | |||||
1341 |
|
1357 | |||
1342 | limit = logcmdutil.getlimit(opts) |
|
1358 | limit = logcmdutil.getlimit(opts) | |
1343 | o, other = _outgoing(ui, repo, dest, opts) |
|
1359 | o, other = _outgoing(ui, repo, dest, opts) | |
|
1360 | try: | |||
1344 | if not o: |
|
1361 | if not o: | |
1345 | cmdutil.outgoinghooks(ui, repo, other, opts, o) |
|
1362 | cmdutil.outgoinghooks(ui, repo, other, opts, o) | |
1346 | return recurse() |
|
1363 | return recurse() | |
@@ -1362,6 +1379,8 def outgoing(ui, repo, dest, opts): | |||||
1362 | cmdutil.outgoinghooks(ui, repo, other, opts, o) |
|
1379 | cmdutil.outgoinghooks(ui, repo, other, opts, o) | |
1363 | recurse() |
|
1380 | recurse() | |
1364 | return 0 # exit code is zero since we found outgoing changes |
|
1381 | return 0 # exit code is zero since we found outgoing changes | |
|
1382 | finally: | |||
|
1383 | other.close() | |||
1365 |
|
1384 | |||
1366 |
|
1385 | |||
1367 | def verify(repo, level=None): |
|
1386 | def verify(repo, level=None): |
@@ -1841,9 +1841,12 def outgoing(repo, subset, x): | |||||
1841 | if revs: |
|
1841 | if revs: | |
1842 | revs = [repo.lookup(rev) for rev in revs] |
|
1842 | revs = [repo.lookup(rev) for rev in revs] | |
1843 | other = hg.peer(repo, {}, dest) |
|
1843 | other = hg.peer(repo, {}, dest) | |
|
1844 | try: | |||
1844 | repo.ui.pushbuffer() |
|
1845 | repo.ui.pushbuffer() | |
1845 | outgoing = discovery.findcommonoutgoing(repo, other, onlyheads=revs) |
|
1846 | outgoing = discovery.findcommonoutgoing(repo, other, onlyheads=revs) | |
1846 | repo.ui.popbuffer() |
|
1847 | repo.ui.popbuffer() | |
|
1848 | finally: | |||
|
1849 | other.close() | |||
1847 | cl = repo.changelog |
|
1850 | cl = repo.changelog | |
1848 | o = {cl.rev(r) for r in outgoing.missing} |
|
1851 | o = {cl.rev(r) for r in outgoing.missing} | |
1849 | return subset & o |
|
1852 | return subset & o |
@@ -175,10 +175,7 def _cleanuppipes(ui, pipei, pipeo, pipe | |||||
175 | # to deadlocks due to a peer get gc'ed in a fork |
|
175 | # to deadlocks due to a peer get gc'ed in a fork | |
176 | # We add our own stack trace, because the stacktrace when called |
|
176 | # We add our own stack trace, because the stacktrace when called | |
177 | # from __del__ is useless. |
|
177 | # from __del__ is useless. | |
178 | if False: # enabled in next commit |
|
178 | ui.develwarn(b'missing close on SSH connection created at:\n%s' % warn) | |
179 | ui.develwarn( |
|
|||
180 | b'missing close on SSH connection created at:\n%s' % warn |
|
|||
181 | ) |
|
|||
182 |
|
179 | |||
183 |
|
180 | |||
184 | def _makeconnection(ui, sshcmd, args, remotecmd, path, sshenv=None): |
|
181 | def _makeconnection(ui, sshcmd, args, remotecmd, path, sshenv=None): |
@@ -716,13 +716,17 class hgsubrepo(abstractsubrepo): | |||||
716 | _(b'sharing subrepo %s from %s\n') |
|
716 | _(b'sharing subrepo %s from %s\n') | |
717 | % (subrelpath(self), srcurl) |
|
717 | % (subrelpath(self), srcurl) | |
718 | ) |
|
718 | ) | |
|
719 | peer = getpeer() | |||
|
720 | try: | |||
719 | shared = hg.share( |
|
721 | shared = hg.share( | |
720 | self._repo._subparent.baseui, |
|
722 | self._repo._subparent.baseui, | |
721 |
|
|
723 | peer, | |
722 | self._repo.root, |
|
724 | self._repo.root, | |
723 | update=False, |
|
725 | update=False, | |
724 | bookmarks=False, |
|
726 | bookmarks=False, | |
725 | ) |
|
727 | ) | |
|
728 | finally: | |||
|
729 | peer.close() | |||
726 | self._repo = shared.local() |
|
730 | self._repo = shared.local() | |
727 | else: |
|
731 | else: | |
728 | # TODO: find a common place for this and this code in the |
|
732 | # TODO: find a common place for this and this code in the | |
@@ -743,14 +747,18 class hgsubrepo(abstractsubrepo): | |||||
743 | _(b'cloning subrepo %s from %s\n') |
|
747 | _(b'cloning subrepo %s from %s\n') | |
744 | % (subrelpath(self), util.hidepassword(srcurl)) |
|
748 | % (subrelpath(self), util.hidepassword(srcurl)) | |
745 | ) |
|
749 | ) | |
|
750 | peer = getpeer() | |||
|
751 | try: | |||
746 | other, cloned = hg.clone( |
|
752 | other, cloned = hg.clone( | |
747 | self._repo._subparent.baseui, |
|
753 | self._repo._subparent.baseui, | |
748 | {}, |
|
754 | {}, | |
749 |
|
|
755 | peer, | |
750 | self._repo.root, |
|
756 | self._repo.root, | |
751 | update=False, |
|
757 | update=False, | |
752 | shareopts=shareopts, |
|
758 | shareopts=shareopts, | |
753 | ) |
|
759 | ) | |
|
760 | finally: | |||
|
761 | peer.close() | |||
754 | self._repo = cloned.local() |
|
762 | self._repo = cloned.local() | |
755 | self._initrepo(parentrepo, source, create=True) |
|
763 | self._initrepo(parentrepo, source, create=True) | |
756 | self._cachestorehash(srcurl) |
|
764 | self._cachestorehash(srcurl) | |
@@ -760,7 +768,11 class hgsubrepo(abstractsubrepo): | |||||
760 | % (subrelpath(self), util.hidepassword(srcurl)) |
|
768 | % (subrelpath(self), util.hidepassword(srcurl)) | |
761 | ) |
|
769 | ) | |
762 | cleansub = self.storeclean(srcurl) |
|
770 | cleansub = self.storeclean(srcurl) | |
763 |
|
|
771 | peer = getpeer() | |
|
772 | try: | |||
|
773 | exchange.pull(self._repo, peer) | |||
|
774 | finally: | |||
|
775 | peer.close() | |||
764 | if cleansub: |
|
776 | if cleansub: | |
765 | # keep the repo clean after pull |
|
777 | # keep the repo clean after pull | |
766 | self._cachestorehash(srcurl) |
|
778 | self._cachestorehash(srcurl) | |
@@ -845,7 +857,10 class hgsubrepo(abstractsubrepo): | |||||
845 | % (subrelpath(self), util.hidepassword(dsturl)) |
|
857 | % (subrelpath(self), util.hidepassword(dsturl)) | |
846 | ) |
|
858 | ) | |
847 | other = hg.peer(self._repo, {b'ssh': ssh}, dsturl) |
|
859 | other = hg.peer(self._repo, {b'ssh': ssh}, dsturl) | |
|
860 | try: | |||
848 | res = exchange.push(self._repo, other, force, newbranch=newbranch) |
|
861 | res = exchange.push(self._repo, other, force, newbranch=newbranch) | |
|
862 | finally: | |||
|
863 | other.close() | |||
849 |
|
864 | |||
850 | # the repo is now clean |
|
865 | # the repo is now clean | |
851 | self._cachestorehash(dsturl) |
|
866 | self._cachestorehash(dsturl) |
@@ -21,7 +21,10 def getflogheads(ui, repo, path): | |||||
21 | dest = repo.ui.expandpath(b'default') |
|
21 | dest = repo.ui.expandpath(b'default') | |
22 | peer = hg.peer(repo, {}, dest) |
|
22 | peer = hg.peer(repo, {}, dest) | |
23 |
|
23 | |||
|
24 | try: | |||
24 | flogheads = peer.x_rfl_getflogheads(path) |
|
25 | flogheads = peer.x_rfl_getflogheads(path) | |
|
26 | finally: | |||
|
27 | peer.close() | |||
25 |
|
28 | |||
26 | if flogheads: |
|
29 | if flogheads: | |
27 | for head in flogheads: |
|
30 | for head in flogheads: |
@@ -361,6 +361,7 Empty [acl.allow] | |||||
361 | bundle2-input-bundle: 5 parts total |
|
361 | bundle2-input-bundle: 5 parts total | |
362 | transaction abort! |
|
362 | transaction abort! | |
363 | rollback completed |
|
363 | rollback completed | |
|
364 | truncating cache/rbc-revs-v1 to 8 | |||
364 | abort: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374") |
|
365 | abort: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374") | |
365 | no rollback information available |
|
366 | no rollback information available | |
366 | 0:6675d58eff77 |
|
367 | 0:6675d58eff77 | |
@@ -808,7 +809,6 fred is not blocked from moving bookmark | |||||
808 | acl: acl.deny.bookmarks not enabled |
|
809 | acl: acl.deny.bookmarks not enabled | |
809 | acl: bookmark access granted: "ef1ea85a6374b77d6da9dcda9541f498f2d17df7" on bookmark "moving-bookmark" |
|
810 | acl: bookmark access granted: "ef1ea85a6374b77d6da9dcda9541f498f2d17df7" on bookmark "moving-bookmark" | |
810 | bundle2-input-bundle: 7 parts total |
|
811 | bundle2-input-bundle: 7 parts total | |
811 | truncating cache/rbc-revs-v1 to 8 |
|
|||
812 | updating the branch cache |
|
812 | updating the branch cache | |
813 | invalid branch cache (served.hidden): tip differs |
|
813 | invalid branch cache (served.hidden): tip differs | |
814 | added 1 changesets with 1 changes to 1 files |
|
814 | added 1 changesets with 1 changes to 1 files | |
@@ -900,6 +900,7 fred is not allowed to move bookmarks | |||||
900 | bundle2-input-bundle: 7 parts total |
|
900 | bundle2-input-bundle: 7 parts total | |
901 | transaction abort! |
|
901 | transaction abort! | |
902 | rollback completed |
|
902 | rollback completed | |
|
903 | truncating cache/rbc-revs-v1 to 8 | |||
903 | abort: acl: user "fred" denied on bookmark "moving-bookmark" (changeset "ef1ea85a6374b77d6da9dcda9541f498f2d17df7") |
|
904 | abort: acl: user "fred" denied on bookmark "moving-bookmark" (changeset "ef1ea85a6374b77d6da9dcda9541f498f2d17df7") | |
904 | no rollback information available |
|
905 | no rollback information available | |
905 | 0:6675d58eff77 |
|
906 | 0:6675d58eff77 | |
@@ -985,7 +986,6 barney is allowed everywhere | |||||
985 | bundle2-input-part: "phase-heads" supported |
|
986 | bundle2-input-part: "phase-heads" supported | |
986 | bundle2-input-part: total payload size 24 |
|
987 | bundle2-input-part: total payload size 24 | |
987 | bundle2-input-bundle: 5 parts total |
|
988 | bundle2-input-bundle: 5 parts total | |
988 | truncating cache/rbc-revs-v1 to 8 |
|
|||
989 | updating the branch cache |
|
989 | updating the branch cache | |
990 | added 3 changesets with 3 changes to 3 files |
|
990 | added 3 changesets with 3 changes to 3 files | |
991 | bundle2-output-bundle: "HG20", 1 parts total |
|
991 | bundle2-output-bundle: "HG20", 1 parts total | |
@@ -1073,6 +1073,7 wilma can change files with a .txt exten | |||||
1073 | bundle2-input-bundle: 5 parts total |
|
1073 | bundle2-input-bundle: 5 parts total | |
1074 | transaction abort! |
|
1074 | transaction abort! | |
1075 | rollback completed |
|
1075 | rollback completed | |
|
1076 | truncating cache/rbc-revs-v1 to 8 | |||
1076 | abort: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae") |
|
1077 | abort: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae") | |
1077 | no rollback information available |
|
1078 | no rollback information available | |
1078 | 0:6675d58eff77 |
|
1079 | 0:6675d58eff77 | |
@@ -1322,7 +1323,6 acl.config can set only [acl.allow]/[acl | |||||
1322 | bundle2-input-part: "phase-heads" supported |
|
1323 | bundle2-input-part: "phase-heads" supported | |
1323 | bundle2-input-part: total payload size 24 |
|
1324 | bundle2-input-part: total payload size 24 | |
1324 | bundle2-input-bundle: 5 parts total |
|
1325 | bundle2-input-bundle: 5 parts total | |
1325 | truncating cache/rbc-revs-v1 to 8 |
|
|||
1326 | updating the branch cache |
|
1326 | updating the branch cache | |
1327 | added 3 changesets with 3 changes to 3 files |
|
1327 | added 3 changesets with 3 changes to 3 files | |
1328 | bundle2-output-bundle: "HG20", 1 parts total |
|
1328 | bundle2-output-bundle: "HG20", 1 parts total | |
@@ -1499,6 +1499,7 no one is allowed inside foo/Bar/ | |||||
1499 | bundle2-input-bundle: 5 parts total |
|
1499 | bundle2-input-bundle: 5 parts total | |
1500 | transaction abort! |
|
1500 | transaction abort! | |
1501 | rollback completed |
|
1501 | rollback completed | |
|
1502 | truncating cache/rbc-revs-v1 to 8 | |||
1502 | abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8") |
|
1503 | abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8") | |
1503 | no rollback information available |
|
1504 | no rollback information available | |
1504 | 0:6675d58eff77 |
|
1505 | 0:6675d58eff77 | |
@@ -1583,7 +1584,6 OS-level groups | |||||
1583 | bundle2-input-part: "phase-heads" supported |
|
1584 | bundle2-input-part: "phase-heads" supported | |
1584 | bundle2-input-part: total payload size 24 |
|
1585 | bundle2-input-part: total payload size 24 | |
1585 | bundle2-input-bundle: 5 parts total |
|
1586 | bundle2-input-bundle: 5 parts total | |
1586 | truncating cache/rbc-revs-v1 to 8 |
|
|||
1587 | updating the branch cache |
|
1587 | updating the branch cache | |
1588 | added 3 changesets with 3 changes to 3 files |
|
1588 | added 3 changesets with 3 changes to 3 files | |
1589 | bundle2-output-bundle: "HG20", 1 parts total |
|
1589 | bundle2-output-bundle: "HG20", 1 parts total | |
@@ -1671,6 +1671,7 OS-level groups | |||||
1671 | bundle2-input-bundle: 5 parts total |
|
1671 | bundle2-input-bundle: 5 parts total | |
1672 | transaction abort! |
|
1672 | transaction abort! | |
1673 | rollback completed |
|
1673 | rollback completed | |
|
1674 | truncating cache/rbc-revs-v1 to 8 | |||
1674 | abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8") |
|
1675 | abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8") | |
1675 | no rollback information available |
|
1676 | no rollback information available | |
1676 | 0:6675d58eff77 |
|
1677 | 0:6675d58eff77 |
@@ -382,6 +382,7 test http authentication | |||||
382 | devel-peer-request: 16 bytes of commands arguments in headers |
|
382 | devel-peer-request: 16 bytes of commands arguments in headers | |
383 | devel-peer-request: finished in *.???? seconds (200) (glob) |
|
383 | devel-peer-request: finished in *.???? seconds (200) (glob) | |
384 | received listkey for "phases": 15 bytes |
|
384 | received listkey for "phases": 15 bytes | |
|
385 | (sent 9 HTTP requests and 3898 bytes; received 920 bytes in responses) | |||
385 | $ hg rollback -q |
|
386 | $ hg rollback -q | |
386 |
|
387 | |||
387 | $ sed 's/.*] "/"/' < ../access.log |
|
388 | $ sed 's/.*] "/"/' < ../access.log |
@@ -462,6 +462,7 lfs content, and the extension enabled. | |||||
462 | remote: adding manifests |
|
462 | remote: adding manifests | |
463 | remote: adding file changes |
|
463 | remote: adding file changes | |
464 | remote: added 1 changesets with 1 changes to 1 files |
|
464 | remote: added 1 changesets with 1 changes to 1 files | |
|
465 | (sent 8 HTTP requests and 3526 bytes; received 961 bytes in responses) (?) | |||
465 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES |
|
466 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES | |
466 | .hg/requires:lfs |
|
467 | .hg/requires:lfs | |
467 | $TESTTMP/server/.hg/requires:lfs |
|
468 | $TESTTMP/server/.hg/requires:lfs |
General Comments 0
You need to be logged in to leave comments.
Login now