Mercurial > hg
comparison hgext/fetch.py @ 46907:ffd3e823a7e5
urlutil: extract `url` related code from `util` into the new module
The new module is well fitting for this new code. And this will be useful to
make the gathered code collaborate more later.
Differential Revision: https://phab.mercurial-scm.org/D10374
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 12 Apr 2021 03:01:04 +0200 |
parents | 89a2afe31e82 |
children | b133154f1e7b |
comparison
equal
deleted
inserted
replaced
46906:33524c46a092 | 46907:ffd3e823a7e5 |
---|---|
17 exchange, | 17 exchange, |
18 hg, | 18 hg, |
19 lock, | 19 lock, |
20 pycompat, | 20 pycompat, |
21 registrar, | 21 registrar, |
22 util, | |
23 ) | 22 ) |
24 from mercurial.utils import dateutil | 23 from mercurial.utils import ( |
24 dateutil, | |
25 urlutil, | |
26 ) | |
25 | 27 |
26 release = lock.release | 28 release = lock.release |
27 cmdtable = {} | 29 cmdtable = {} |
28 command = registrar.command(cmdtable) | 30 command = registrar.command(cmdtable) |
29 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | 31 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for |
107 ) | 109 ) |
108 ) | 110 ) |
109 | 111 |
110 other = hg.peer(repo, opts, ui.expandpath(source)) | 112 other = hg.peer(repo, opts, ui.expandpath(source)) |
111 ui.status( | 113 ui.status( |
112 _(b'pulling from %s\n') % util.hidepassword(ui.expandpath(source)) | 114 _(b'pulling from %s\n') |
115 % urlutil.hidepassword(ui.expandpath(source)) | |
113 ) | 116 ) |
114 revs = None | 117 revs = None |
115 if opts[b'rev']: | 118 if opts[b'rev']: |
116 try: | 119 try: |
117 revs = [other.lookup(rev) for rev in opts[b'rev']] | 120 revs = [other.lookup(rev) for rev in opts[b'rev']] |
178 err = hg.merge(p2ctx, remind=False) | 181 err = hg.merge(p2ctx, remind=False) |
179 | 182 |
180 if not err: | 183 if not err: |
181 # we don't translate commit messages | 184 # we don't translate commit messages |
182 message = cmdutil.logmessage(ui, opts) or ( | 185 message = cmdutil.logmessage(ui, opts) or ( |
183 b'Automated merge with %s' % util.removeauth(other.url()) | 186 b'Automated merge with %s' % urlutil.removeauth(other.url()) |
184 ) | 187 ) |
185 editopt = opts.get(b'edit') or opts.get(b'force_editor') | 188 editopt = opts.get(b'edit') or opts.get(b'force_editor') |
186 editor = cmdutil.getcommiteditor(edit=editopt, editform=b'fetch') | 189 editor = cmdutil.getcommiteditor(edit=editopt, editform=b'fetch') |
187 n = repo.commit( | 190 n = repo.commit( |
188 message, opts[b'user'], opts[b'date'], editor=editor | 191 message, opts[b'user'], opts[b'date'], editor=editor |