# HG changeset patch # User Augie Fackler # Date 1225564819 18000 # Node ID fb1d911bb0be3f8f299d07ab33787ff89d630e01 # Parent fd5aadd552c80705843a1af5508a865503760dfc svnclone now updates to the tip revision if it is the initial clone. diff --git a/__init__.py b/__init__.py --- a/__init__.py +++ b/__init__.py @@ -1,3 +1,5 @@ +import os + from mercurial import commands from mercurial import hg @@ -11,7 +13,12 @@ def svn_fetch(ui, svn_url, hg_repo_path= if not hg_repo_path: hg_repo_path = hg.defaultdest(svn_url) + "-hg" ui.status("Assuming destination %s\n" % hg_repo_path) - return fetch_command.fetch_revisions(ui, svn_url, hg_repo_path, **opts) + should_update = not os.path.exists(hg_repo_path) + res = fetch_command.fetch_revisions(ui, svn_url, hg_repo_path, **opts) + if (res is None or res == 0) and should_update: + repo = hg.repository(ui, hg_repo_path) + commands.update(ui, repo, repo['tip'].node()) + return res commands.norepo += " svnclone" cmdtable = {