vcssync: scaffolding for version control syncing project (
bug 1322769); r?glob
Create a skeleton "vcssync" Python package that will contain all our
code for version control syncing.
Over the past few years, several groups have also wanted some form or
another of version control "syncing." Example use cases include:
* Mirroring a Mercurial repository to Git[Hub]
* Mirroring a Git[Hub] repository to Mercurial
* Exporting a subdirectory of mozilla-central to Git[Hub] to
facilitate development on Git[Hub]
* Importing content from a Git repository into mozilla-central
* Converting GitHub Pull Requests into MozReview review requests
Existing "VCS Sync" facilitates #1. And we have haphazard
implementations of some of the other bullet points. Other items are
pipe dreams.
As part of vendoring Servo and more tightly integrating the Servo
and Firefox CI systems, we'll be rolling out a somewhat complicated
change to how Servo and Firefox commits are synchronized and landed.
This requires writing some VCS syncing code. This is a known
consumer of a somewhat more complicated VCS syncing solution that
is a few weeks to months off.
MozReview-Commit-ID: 4xgmgEziptA
--- a/create-test-environment
+++ b/create-test-environment
@@ -130,16 +130,20 @@ cd ../..
cd pylib/mozreview
python setup.py develop
cd ../..
cd pylib/vcsreplicator
python setup.py develop
cd ../..
+cd vcssync
+python setup.py develop
+cd ..
+
cd hghooks
python setup.py develop
cd ..
cd testing
python setup.py develop
cd ..
--- a/testing/vcttesting/testing.py
+++ b/testing/vcttesting/testing.py
@@ -17,24 +17,26 @@ from coverage import coverage
HERE = os.path.dirname(os.path.abspath(__file__))
ROOT = os.path.normpath(os.path.join(HERE, '..', '..'))
PYTHON_COVERAGE_DIRS = (
'hgext',
'pylib',
'hghooks',
+ 'vcssync',
)
# Directories containing Python unit tests.
UNIT_TEST_DIRS = [
'autoland/tests',
'git/tests',
'hgserver/tests',
'pylib',
+ 'vcssync/tests',
]
# Directories whose Python unit tests we should ignore.
UNIT_TEST_IGNORES = (
'pylib/Bugsy',
'pylib/flake8',
'pylib/mccabe',
'pylib/pycodestyle',
new file mode 100644
--- /dev/null
+++ b/vcssync/setup.py
@@ -0,0 +1,18 @@
+from setuptools import setup, find_packages
+
+setup(
+ name='mozvcssync',
+ version='0.1',
+ description='Synchronize changes across VCS repositories',
+ url='https://mozilla-version-control-tools.readthedocs.io/',
+ author='Mozilla',
+ author_email='dev-version-control@lists.mozilla.org',
+ license='MPL 2.0',
+ classifiers=[
+ 'Development Status :: 4 - Beta',
+ 'Intended Audience :: Developers',
+ 'Programming Language :: Python :: 2.7',
+ ],
+ packages=find_packages(),
+ install_requires=['Mercurial>=4.0'],
+)
new file mode 100644
--- /dev/null
+++ b/vcssync/tests/helpers.sh
@@ -0,0 +1,13 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+. $TESTDIR/hgserver/tests/helpers.sh
+
+# make git commits deterministic and environment agnostic
+export GIT_AUTHOR_NAME=test
+export GIT_AUTHOR_EMAIL=test@example.com
+export GIT_AUTHOR_DATE='Thu Jan 1 00:00:00 1970 +0000'
+export GIT_COMMITTER_NAME=test
+export GIT_COMMITTER_EMAIL=test@example.com
+export GIT_COMMITTER_DATE='Thu Jan 1 00:00:00 1970 +0000'
new file mode 100755
--- /dev/null
+++ b/vcssync/tests/hghave
@@ -0,0 +1,8 @@
+#!/usr/bin/env python
+
+import os
+
+HERE = os.path.abspath(os.path.dirname(__file__))
+REPO_ROOT = os.path.join(HERE, '..', '..')
+execfile(os.path.join(REPO_ROOT, 'testing', 'hghave.py'))
+