Package: hg-importfs
Imports a set of files from a given file-system into aMercurialrepository as a changeset.The development of this extension was paid for byLantiq. It was
written and released as Open Source byMarkus Zapke-Gründemann.Repository:https://bitbucket.org/keimlink/hg-importfsIssue tracker:https://bitbucket.org/keimlink/hg-importfs/issuesPython Package Index:http://pypi.python.org/pypi/hg-importfsMercurial wiki:http://mercurial.selenic.com/wiki/ImportfsExtensionInstallationIt is assumed that youalready have Mercurial installed. If not,
please do so first either bydownloadingand installing the
appropriate package for your operating system or by usingpip:$ pip install MercurialAs a Python packageThe easiest way is to install the importfs extension is to usepip:$ pip install hg-importfsUsing easy_install instead of pip is also possible:$ easy_install hg-importfsNow add the extension to the extensions section in your.hgrc/mercurial.inifile:[extensions]
importfs =As a Mercurial repositoryInstead of installing the Python package you can also clone the repository:$ hg clone https://bitbucket.org/keimlink/hg-importfsTo activate the extension you have to add the full path toimportfs.pyto your.hgrc/mercurial.inifile:[extensions]
importfs = /path/to/hg-importfs/importfs.pyUsageAfter installing the extension you can use the following command to show
the full help including all options:$ hg help importfsExampleAssuming you have a project on your file system which has different
versions in different directories. Maybe because you never used a
version control system (VCS) for your project. Or maybe because there is
no convert extension available for the VCS you are using. In our
scenario the three versions of the project look like this:.
├── myproject-v1
│   ├── LICENSE
│   ├── README
│   ├── doc
│   │   ├── index.rst
│   │   ├── start.rst
│   │   └── widgets.rst
│   └── src
│       ├── cmdutils.py
│       ├── dispatcher.py
│       └── widgets.py
├── myproject-v2
│   ├── LICENSE
│   ├── README
│   ├── doc
│   │   ├── index.rst
│   │   ├── start.rst
│   │   └── widgets.rst
│   └── src
│       ├── cmdutils.py
│       ├── dispatcher.py
│       ├── resources.py
│       └── widgets.py
└── myproject-v3
    ├── LICENSE
    ├── README
    ├── doc
    │   ├── index.rst
    │   ├── start.rst
    │   └── widgets.rst
    └── src
        ├── dispatcher.py
        ├── resources.py
        └── widgets.pyRun the following command to import the first version of the project
into a Mercurial repositorymyrepo. The repository does not exist so
it will be created for you:$ hg importfs myrepo myproject-v1
created repository myrepo
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
adding LICENSE
adding README
adding doc/index.rst
adding doc/start.rst
adding doc/widgets.rst
adding src/cmdutils.py
adding src/dispatcher.py
adding src/widgets.pyNow you have a repository with one changeset. This changeset contains
all your files frommyproject-v1.$ hg log -R myrepo
changeset:   0:60304fa41a49
tag:         tip
user:        Markus Zapke-Gründemann <markus@keimlink.de>
date:        Tue Jul 10 10:19:10 2012 +0200
summary:     importfs commit.As you can see importfs created a commit message for you because you
didn’t specify one for the first import.The second import will put all the files frommyproject-v2as a new
changeset on top of changeset 0. And this time we want to use our own
commit message and tag the changeset:$ hg importfs myrepo myproject-v2 -m "Second import." -t second_import
8 files updated, 0 files merged, 0 files removed, 0 files unresolved
adding src/resources.pyNow there are two new changesets:$ hg log -R myrepo
changeset:   2:c8ff824da6c8
tag:         tip
user:        Markus Zapke-Gründemann <markus@keimlink.de>
date:        Tue Jul 10 10:27:10 2012 +0200
summary:     Added tag second_import for changeset 825c9a9356fd

changeset:   1:825c9a9356fd
tag:         second_import
user:        Markus Zapke-Gründemann <markus@keimlink.de>
date:        Tue Jul 10 10:27:10 2012 +0200
summary:     Second import.

changeset:   0:60304fa41a49
user:        Markus Zapke-Gründemann <markus@keimlink.de>
date:        Tue Jul 10 10:19:10 2012 +0200
summary:     importfs commit.Let’s import the last version of the project into a new branch with
changeset 0 as parent:$ hg importfs myrepo myproject-v3 -m "Third import." -t third_import -b branch_2 -r 0
8 files updated, 0 files merged, 1 files removed, 0 files unresolved
marked working directory as branch branch_2
(branches are permanent and global, did you want a bookmark?)
removing src/cmdutils.py
adding src/resources.pyThe repository history looks now like this:$ hg glog -R myrepo
@  changeset:   4:3ec5adb0448e
|  branch:      branch_2
|  tag:         tip
|  user:        Markus Zapke-Gründemann <markus@keimlink.de>
|  date:        Tue Jul 10 10:32:32 2012 +0200
|  summary:     Added tag third_import for changeset bfcf48ac159e
|
o  changeset:   3:bfcf48ac159e
|  branch:      branch_2
|  tag:         third_import
|  parent:      0:60304fa41a49
|  user:        Markus Zapke-Gründemann <markus@keimlink.de>
|  date:        Tue Jul 10 10:32:32 2012 +0200
|  summary:     Third import.
|
| o  changeset:   2:c8ff824da6c8
| |  user:        Markus Zapke-Gründemann <markus@keimlink.de>
| |  date:        Tue Jul 10 10:27:10 2012 +0200
| |  summary:     Added tag second_import for changeset 825c9a9356fd
| |
| o  changeset:   1:825c9a9356fd
|/   tag:         second_import
|    user:        Markus Zapke-Gründemann <markus@keimlink.de>
|    date:        Tue Jul 10 10:27:10 2012 +0200
|    summary:     Second import.
|
o  changeset:   0:60304fa41a49
   user:        Markus Zapke-Gründemann <markus@keimlink.de>
   date:        Tue Jul 10 10:19:10 2012 +0200
   summary:     importfs commit.How to set up a development environmentIf you havn’t created a clone of the importfs repository yet it’s time
to do it now:$ hg clone https://bitbucket.org/keimlink/hg-importfsSetup a virtualenvThe best way to do the development is to use avirtualenv. So first
create one usingvirtualenvwrapper:$ mkvirtualenv --distribute hg-importfsThen install all packages needed for development into the virtualenv
usingpip:(hg-importfs)$ cd hg-importfs
(hg-importfs)$ pip install -r requirements.txtYou also need a clone of the hg repository:(hg-importfs)$ cd ..
(hg-importfs)$ hg clone http://selenic.com/repo/hgUpdate to your desired version (if you don’t want to usetip) and
build for local use:(hg-importfs)$ cd hg
(hg-importfs)$ hg up VERSION
(hg-importfs)$ make localAfter creating the clone create a few symlinks in your importfs repository:(hg-importfs)$ cd ../hg-importfs
(hg-importfs)$ ln -s ../hg/contrib/pylintrc
(hg-importfs)$ ln -s ../hg/tests/hghave
(hg-importfs)$ ln -s ../hg/tests/run-tests.pyFinally add the hg directory to your virtualenv:(hg-importfs)$ add2virtualenv ../hgRun the testsTo run all tests you can now execute the following command:(hg-importfs)$ ./run-tests.py -lCreate a new source distribution packageA new Python source distribution package can be created using this command:(hg-importfs)$ python setup.py sdistChangelog1.3.2Tested with 2.2.3, 2.3, 2.3.1, 2.3.2, 2.4Updated documentationAdded links to issue tracker1.3.1Improved installation instructions1.3.0Changed package name to hg-importfs (as initially intended)1.2.3Changelog appears now at the of package descriptionAdded repository and PyPI urls to README1.2.2Removed reStructuredText header from CHANGELOG.rst1.2.1Updated README to render as reStructuredText on PyPI1.2.0First Open Source release!Added testedwith variableTest suite works now with Mercurial 2.2.xAdded installation instructions and example to READMEMoved development information to README1.1.0Symlinks are no longer dereferenced on Linux (but still dereferenced on
Windows).If the path of a symlink on Linux contains backward slashes (i.e. the link
was intended for Windows), the slashes are converted to forward slashes and
the link is dereferenced.Renamed –exclude option to –exclude-pattern.Added new option –exclude-path to exclude a path relative to SOURCE.Added new option –retain-empty-dirs to import empty directories.The update operation inside the repository is using the –clean option.The repository is purged before each update/commit because there can be files
without write permissions and Mercurial fails to update them.1.0.1Write warnings on ignored copy errors to stdout instead of stderr.Using a slash as new exclude pattern separator.1.0Added new options exclude and ignore-copy-errors.0.9Allow to create anonymous branches.0.8.1Fixed the problem with wrong permissons of single files in the root of the
repo on Windows.0.8Changed filesystem operations to be OS independent. Extension can now be used on Windows.SOURCE can now be a list of directories.0.7.1Fixed the version number (which was still 0.6 for the 0.7 release).0.7Removed the “dereference” option.0.6Fixed missing updates. The repository wasn’t always at the lastest revision
when doing the import.Added new option “dereference” to follow symlinks.Updated package classifiers.Added this Changelog.Added long_description to package metadata.0.5.1Removed importfs.py from MANIFEST.in.0.5Initial release.