### Navigation

- index
- modules |
- next |
- previous |
- versuchung 0.1-0 documentation »
- Experiment Parameters »

# Archives and Version Control Systems

If you have your programs in a git archive, you can use `GitArchive` as input parameter and build the software every time from scratch in order to have a clean enviroment for the experiment. Similar you can use a tar achive for this purpose.

class `versuchung.archives.``GitArchive`(clone_url=None, ref='refs/heads/master', shallow=False)

  Can be used as: input parameter

  The git repository given in `clone_url` will be cloned to a temporary directory. It will be removed after the experiment is over. If `shallow == True` Only the files and not the .git is copied (cloned). This is especially useful for large git repositories like the Linux kernel tree.

  `clone_url` can either be a `string` or any object that has a `.path` attribute (like e.g. `TarArchive`). Of course the refenced path must be a directory.

  This parameter can be used as argument to the with keyword, to change to the temporary directory:

      with self.inputs.git_archive as path:
          # Here we have path == os.path.abspath(os.curdir)
          # Do something in the extracted copy
          print path

  `checkout_hash`()

    Return the hash of the HEAD commit hash as string

  `checkout_ref`()

    Return git ref which was checked out

  `checkout_url`()

    Return git url which was checked out

  `path`

    Return the string to the extract directory (same as .value.path)

  `value`

    Return a `versuchung.files.Directory` instance to the cloned git directory

class `versuchung.archives.``TarArchive`(filename=None)

  Can be used as: input parameter

  The archive will be extracted to a temporary directory. It will be removed after the experiment is over.

  `clone_url` can either be a `string` or any object that has a `.path` attribute (like e.g. `File`). Of course the referenced file must be a single file.

  This parameter can be used as argument to the with keyword, to change to the temporary directory:

      with self.inputs.tar_archive as path:
          # Here we have path == os.path.abspath(os.curdir)
          # Do something in the extracted copy
          print path

  `path`

    Return the string to the extract directory (same as .value.path)

  `value`

    Return a `versuchung.files.Directory` instance to the extracted tar archive. If it contains only one directory the instance will point there. Otherwise it will point to a directory containing the contents of the archive

### Navigation

- index
- modules |
- next |
- previous |
- versuchung 0.1-0 documentation »
- Experiment Parameters »