Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 5525:dcbda0c4c3eb
Do not display passwords with pull/push/incoming/outgoing
Passwords specified in the repository URL are now displayed as '***'
when accessing the remote repository.
author | Manuel Holtgrewe <purestorm@ggnore.net> |
---|---|
date | Mon, 05 Nov 2007 20:29:32 +0100 |
parents | e5eedd74e70f |
children | 253736bb0dc9 000ed6873951 |
comparison
equal
deleted
inserted
replaced
5524:453acf64f71f | 5525:dcbda0c4c3eb |
---|---|
1650 """ | 1650 """ |
1651 source, revs, checkout = hg.parseurl(ui.expandpath(source), opts['rev']) | 1651 source, revs, checkout = hg.parseurl(ui.expandpath(source), opts['rev']) |
1652 cmdutil.setremoteconfig(ui, opts) | 1652 cmdutil.setremoteconfig(ui, opts) |
1653 | 1653 |
1654 other = hg.repository(ui, source) | 1654 other = hg.repository(ui, source) |
1655 ui.status(_('comparing with %s\n') % source) | 1655 ui.status(_('comparing with %s\n') % util.hidepassword(source)) |
1656 if revs: | 1656 if revs: |
1657 revs = [other.lookup(rev) for rev in revs] | 1657 revs = [other.lookup(rev) for rev in revs] |
1658 incoming = repo.findincoming(other, heads=revs, force=opts["force"]) | 1658 incoming = repo.findincoming(other, heads=revs, force=opts["force"]) |
1659 if not incoming: | 1659 if not incoming: |
1660 try: | 1660 try: |
1960 cmdutil.setremoteconfig(ui, opts) | 1960 cmdutil.setremoteconfig(ui, opts) |
1961 if revs: | 1961 if revs: |
1962 revs = [repo.lookup(rev) for rev in revs] | 1962 revs = [repo.lookup(rev) for rev in revs] |
1963 | 1963 |
1964 other = hg.repository(ui, dest) | 1964 other = hg.repository(ui, dest) |
1965 ui.status(_('comparing with %s\n') % dest) | 1965 ui.status(_('comparing with %s\n') % util.hidepassword(dest)) |
1966 o = repo.findoutgoing(other, force=opts['force']) | 1966 o = repo.findoutgoing(other, force=opts['force']) |
1967 if not o: | 1967 if not o: |
1968 ui.status(_("no changes found\n")) | 1968 ui.status(_("no changes found\n")) |
1969 return 1 | 1969 return 1 |
1970 o = repo.changelog.nodesbetween(o, revs)[0] | 1970 o = repo.changelog.nodesbetween(o, revs)[0] |
2093 """ | 2093 """ |
2094 source, revs, checkout = hg.parseurl(ui.expandpath(source), opts['rev']) | 2094 source, revs, checkout = hg.parseurl(ui.expandpath(source), opts['rev']) |
2095 cmdutil.setremoteconfig(ui, opts) | 2095 cmdutil.setremoteconfig(ui, opts) |
2096 | 2096 |
2097 other = hg.repository(ui, source) | 2097 other = hg.repository(ui, source) |
2098 ui.status(_('pulling from %s\n') % (source)) | 2098 ui.status(_('pulling from %s\n') % util.hidepassword(source)) |
2099 if revs: | 2099 if revs: |
2100 try: | 2100 try: |
2101 revs = [other.lookup(rev) for rev in revs] | 2101 revs = [other.lookup(rev) for rev in revs] |
2102 except repo.NoCapability: | 2102 except repo.NoCapability: |
2103 error = _("Other repository doesn't support revision lookup, " | 2103 error = _("Other repository doesn't support revision lookup, " |
2140 dest, revs, checkout = hg.parseurl( | 2140 dest, revs, checkout = hg.parseurl( |
2141 ui.expandpath(dest or 'default-push', dest or 'default'), opts['rev']) | 2141 ui.expandpath(dest or 'default-push', dest or 'default'), opts['rev']) |
2142 cmdutil.setremoteconfig(ui, opts) | 2142 cmdutil.setremoteconfig(ui, opts) |
2143 | 2143 |
2144 other = hg.repository(ui, dest) | 2144 other = hg.repository(ui, dest) |
2145 ui.status('pushing to %s\n' % (dest)) | 2145 ui.status('pushing to %s\n' % util.hidepassword(dest)) |
2146 if revs: | 2146 if revs: |
2147 revs = [repo.lookup(rev) for rev in revs] | 2147 revs = [repo.lookup(rev) for rev in revs] |
2148 r = repo.push(other, opts['force'], revs=revs) | 2148 r = repo.push(other, opts['force'], revs=revs) |
2149 return r == 0 | 2149 return r == 0 |
2150 | 2150 |