Mercurial > hg
changeset 2426:fb942bc15ef9
merge with crew.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Mon, 12 Jun 2006 09:36:44 -0700 |
parents | be2fd6398d50 (current diff) 092039246d73 (diff) |
children | 150cde10ea21 |
files | |
diffstat | 4 files changed, 30 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/localrepo.py Mon Jun 12 09:36:23 2006 -0700 +++ b/mercurial/localrepo.py Mon Jun 12 09:36:44 2006 -0700 @@ -1550,8 +1550,8 @@ newheads = len(self.changelog.heads()) heads = "" - if oldheads and newheads > oldheads: - heads = _(" (+%d heads)") % (newheads - oldheads) + if oldheads and newheads != oldheads: + heads = _(" (%+d heads)") % (newheads - oldheads) self.ui.status(_("added %d changesets" " with %d changes to %d files%s\n")
--- a/mercurial/sshrepo.py Mon Jun 12 09:36:23 2006 -0700 +++ b/mercurial/sshrepo.py Mon Jun 12 09:36:44 2006 -0700 @@ -37,24 +37,31 @@ self.pipeo, self.pipei, self.pipee = os.popen3(cmd, 'b') # skip any noise generated by remote shell + self.do_cmd("hello") r = self.do_cmd("between", pairs=("%s-%s" % ("0"*40, "0"*40))) - l1 = "" - l2 = "dummy" + lines = ["", "dummy"] max_noise = 500 - while l2 and max_noise: - l2 = r.readline() + while lines[-1] and max_noise: + l = r.readline() self.readerr() - if l1 == "1\n" and l2 == "\n": + if lines[-1] == "1\n" and l == "\n": break - if l1: - ui.debug(_("remote: "), l1) - l1 = l2 + if l: + ui.debug(_("remote: "), l) + lines.append(l) max_noise -= 1 else: if l1: ui.debug(_("remote: "), l1) raise hg.RepoError(_("no response from remote hg")) + self.capabilities = () + lines.reverse() + for l in lines: + if l.startswith("capabilities:"): + self.capabilities = l[:-1].split(":")[1].split() + break + def readerr(self): while 1: size = util.fstat(self.pipee).st_size
--- a/mercurial/sshserver.py Mon Jun 12 09:36:23 2006 -0700 +++ b/mercurial/sshserver.py Mon Jun 12 09:36:44 2006 -0700 @@ -51,6 +51,18 @@ h = self.repo.heads() self.respond(" ".join(map(hex, h)) + "\n") + def do_hello(self): + '''the hello command returns a set of lines describing various + interesting things about the server, in an RFC822-like format. + Currently the only one defined is "capabilities", which + consists of a line in the form: + + capabilities: space separated list of tokens + ''' + + r = "capabilities:\n" + self.respond(r) + def do_lock(self): self.lock = self.repo.lock() self.respond("")