changeset 42281:4274b1369b75

automation: add check that hg source directory is a repo Synchronizing from e.g. source distributions is not yet supported. Let's add a check so we fail with an error message indicating such. Differential Revision: https://phab.mercurial-scm.org/D6315
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 19 Apr 2019 08:21:02 -0700
parents e570106beda1
children 5c242c427897
files contrib/automation/hgautomation/windows.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/automation/hgautomation/windows.py	Fri Apr 19 07:34:55 2019 -0700
+++ b/contrib/automation/hgautomation/windows.py	Fri Apr 19 08:21:02 2019 -0700
@@ -156,6 +156,10 @@
             fh.write('  UserKnownHostsFile %s\n' % (ssh_dir / 'known_hosts'))
             fh.write('  IdentityFile %s\n' % (ssh_dir / 'id_rsa'))
 
+        if not (hg_repo / '.hg').is_dir():
+            raise Exception('%s is not a Mercurial repository; '
+                            'synchronization not yet supported' % hg_repo)
+
         env = dict(os.environ)
         env['HGPLAIN'] = '1'
         env['HGENCODING'] = 'utf-8'