Patchwork debugdiscovery: remove localheads/remoteheads/serverlogs arguments

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 30, 2015, 10:03 a.m.
Message ID <a39a1b919f4f7a3dee36.1451469839@waste.org>
Download mbox | patch
Permalink /patch/12418/
State Rejected
Headers show

Comments

timeless@mozdev.org - Dec. 30, 2015, 10:03 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1451467486 0
#      Wed Dec 30 09:24:46 2015 +0000
# Node ID a39a1b919f4f7a3dee3697c006294899c5d3dd1a
# Parent  23541bdd1610c08af247f9c8719045cf247ce541
debugdiscovery: remove localheads/remoteheads/serverlogs arguments

There was code for serverlogs, but it assumed that there was code
for localheads and remoteheads, but the only code was for localheads,
and that code is just enough to say you can not use this in one of
the two codepaths.

Thus, all of it is dead code.
timeless - Dec. 31, 2015, 6:40 a.m.
Let's not go this way.

I'm sending a replacement series:
1c05 [PATCH 1 of 3] debugdiscovery: support default-push ...
d975 [PATCH 2 of 3] debugdiscovery: add support for local_head and
remote_head ...
2afc [PATCH 3 of 3] debugdiscovery: add serverlog support ...

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2270,7 +2270,7 @@ 
     ('', 'nonheads', None,
      _('use old-style discovery with non-heads included')),
     ] + remoteopts,
-    _('[-l REV] [-r REV] [-b BRANCH]... [OTHER]'))
+    _('... [OTHER]'))
 def debugdiscovery(ui, repo, remoteurl="default", **opts):
     """runs the changeset discovery protocol in isolation"""
     remoteurl, branches = hg.parseurl(ui.expandpath(remoteurl),
@@ -2281,11 +2281,8 @@ 
     # make sure tests are repeatable
     random.seed(12323)
 
-    def doit(localheads, remoteheads, remote=remote):
+    if True:
         if opts.get('old'):
-            if localheads:
-                raise error.Abort('cannot use localheads with old style '
-                                 'discovery')
             if not util.safehasattr(remote, 'branches'):
                 # enable in-client legacy support
                 remote = localrepo.locallegacypeer(remote.local())
@@ -2310,31 +2307,6 @@ 
         elif rheads <= common:
             ui.write(("remote is subset\n"))
 
-    serverlogs = opts.get('serverlog')
-    if serverlogs:
-        for filename in serverlogs:
-            logfile = open(filename, 'r')
-            try:
-                line = logfile.readline()
-                while line:
-                    parts = line.strip().split(';')
-                    op = parts[1]
-                    if op == 'cg':
-                        pass
-                    elif op == 'cgss':
-                        doit(parts[2].split(' '), parts[3].split(' '))
-                    elif op == 'unb':
-                        doit(parts[3].split(' '), parts[2].split(' '))
-                    line = logfile.readline()
-            finally:
-                logfile.close()
-
-    else:
-        remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches,
-                                                 opts.get('remote_head'))
-        localrevs = opts.get('local_head')
-        doit(localrevs, remoterevs)
-
 @command('debugextensions', formatteropts, [], norepo=True)
 def debugextensions(ui, **opts):
     '''show information about active extensions'''