Patchwork D10419: share: use `get_clone_path`

login
register
mail settings
Submitter phabricator
Date April 14, 2021, 11:40 p.m.
Message ID <differential-rev-PHID-DREV-rcvgq4cxs2rjkq3lfwut-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48733/
State Superseded
Headers show

Comments

phabricator - April 14, 2021, 11:40 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Since `hg share` is mostly like clone, do the same changes there.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10419

AFFECTED FILES
  mercurial/hg.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -305,11 +305,10 @@ 
     if not dest:
         dest = defaultdest(source)
     else:
-        dest = ui.expandpath(dest)
+        dest = urlutil.get_clone_path(ui, dest)[1]
 
     if isinstance(source, bytes):
-        origsource = ui.expandpath(source)
-        source, branches = urlutil.parseurl(origsource)
+        origsource, source, branches = urlutil.get_clone_path(ui, source)
         srcrepo = repository(ui, source)
         rev, checkout = addbranchrevs(srcrepo, srcrepo, branches, None)
     else: