Mercurial > hg
comparison hgext/patchbomb.py @ 12793:469850088fc1 stable
patchbomb: hide passwords potentially embedded in urls
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Wed, 20 Oct 2010 23:39:48 +0200 |
parents | 4c1fe996838c |
children | 6bf8d48bec8e |
comparison
equal
deleted
inserted
replaced
12737:7adb1274a4f9 | 12793:469850088fc1 |
---|---|
74 ''' | 74 ''' |
75 | 75 |
76 import os, errno, socket, tempfile, cStringIO, time | 76 import os, errno, socket, tempfile, cStringIO, time |
77 import email.MIMEMultipart, email.MIMEBase | 77 import email.MIMEMultipart, email.MIMEBase |
78 import email.Utils, email.Encoders, email.Generator | 78 import email.Utils, email.Encoders, email.Generator |
79 from mercurial import cmdutil, commands, hg, mail, patch, util, discovery | 79 from mercurial import cmdutil, commands, hg, mail, patch, util, discovery, url |
80 from mercurial.i18n import _ | 80 from mercurial.i18n import _ |
81 from mercurial.node import bin | 81 from mercurial.node import bin |
82 | 82 |
83 def prompt(ui, prompt, default=None, rest=':'): | 83 def prompt(ui, prompt, default=None, rest=':'): |
84 if not ui.interactive(): | 84 if not ui.interactive(): |
249 dest, branches = hg.parseurl(dest) | 249 dest, branches = hg.parseurl(dest) |
250 revs, checkout = hg.addbranchrevs(repo, repo, branches, revs) | 250 revs, checkout = hg.addbranchrevs(repo, repo, branches, revs) |
251 if revs: | 251 if revs: |
252 revs = [repo.lookup(rev) for rev in revs] | 252 revs = [repo.lookup(rev) for rev in revs] |
253 other = hg.repository(hg.remoteui(repo, opts), dest) | 253 other = hg.repository(hg.remoteui(repo, opts), dest) |
254 ui.status(_('comparing with %s\n') % dest) | 254 ui.status(_('comparing with %s\n') % url.hidepassword(dest)) |
255 o = discovery.findoutgoing(repo, other) | 255 o = discovery.findoutgoing(repo, other) |
256 if not o: | 256 if not o: |
257 ui.status(_("no changes found\n")) | 257 ui.status(_("no changes found\n")) |
258 return [] | 258 return [] |
259 o = repo.changelog.nodesbetween(o, revs)[0] | 259 o = repo.changelog.nodesbetween(o, revs)[0] |