diff hgext/largefiles/overrides.py @ 24812:e4e69cebeedd stable

largefiles: don't crash when cloning to a remote repo The immediate crash was when checking for requirements immediately after this, but lfcommands.downloadlfiles() will also crash if --all-largefiles is specified. That has been in place since atleast 5884812686f7 (2.3-rc) without anyone noticing. I can't tell from the peer classes if there's a way to make the custom largefile functionality work in this case, but atleast it doesn't crash.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 18 Apr 2015 00:34:38 -0400
parents b8c3a0994b37
children 2553ef7355ab
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Fri Apr 17 14:12:01 2015 -0700
+++ b/hgext/largefiles/overrides.py	Sat Apr 18 00:34:38 2015 -0400
@@ -838,6 +838,12 @@
         sourcerepo, destrepo = result
         repo = destrepo.local()
 
+        # When cloning to a remote repo (like through SSH), no repo is available
+        # from the peer.   Therefore the largefiles can't be downloaded and the
+        # hgrc can't be updated.
+        if not repo:
+            return result
+
         # If largefiles is required for this repo, permanently enable it locally
         if 'largefiles' in repo.requirements:
             fp = repo.vfs('hgrc', 'a', text=True)