[PATCH] debugdiscovery: remove localheads/remoteheads/serverlogs arguments

timeless timeless at mozdev.org
Wed Dec 30 10:03:59 UTC 2015


# HG changeset patch
# User timeless <timeless at 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.

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'''


More information about the Mercurial-devel mailing list