Mercurial > hgsubversion
comparison __init__.py @ 140:9ffde8662967
util: Add a command to normalize svn urls and use it in a couple of places. Test that it works and prevents failed assertions.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Thu, 11 Dec 2008 20:41:57 -0600 |
parents | 291925677a9f |
children | 42958d9de864 |
comparison
equal
deleted
inserted
replaced
139:89a737852d33 | 140:9ffde8662967 |
---|---|
21 def svn_fetch(ui, svn_url, hg_repo_path=None, **opts): | 21 def svn_fetch(ui, svn_url, hg_repo_path=None, **opts): |
22 if not hg_repo_path: | 22 if not hg_repo_path: |
23 hg_repo_path = hg.defaultdest(svn_url) + "-hg" | 23 hg_repo_path = hg.defaultdest(svn_url) + "-hg" |
24 ui.status("Assuming destination %s\n" % hg_repo_path) | 24 ui.status("Assuming destination %s\n" % hg_repo_path) |
25 should_update = not os.path.exists(hg_repo_path) | 25 should_update = not os.path.exists(hg_repo_path) |
26 svn_url = util.normalize_url(svn_url) | |
26 res = fetch_command.fetch_revisions(ui, svn_url, hg_repo_path, **opts) | 27 res = fetch_command.fetch_revisions(ui, svn_url, hg_repo_path, **opts) |
27 if (res is None or res == 0) and should_update: | 28 if (res is None or res == 0) and should_update: |
28 repo = hg.repository(ui, hg_repo_path) | 29 repo = hg.repository(ui, hg_repo_path) |
29 commands.update(ui, repo, repo['tip'].node()) | 30 commands.update(ui, repo, repo['tip'].node()) |
30 return res | 31 return res |