How to use the gitman.update function in gitman

To help you get started, we’ve selected a few gitman examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jacebrowning / gitman / tests / test_api.py View on Github external
def it_records_all_versions_when_no_arguments(config):
        expect(gitman.update(depth=1, lock=False)) == True
        expect(gitman.lock()) == True

        config.datafile.load()
        expect(config.datafile.text).contains(
            strip(
                """
        sources_locked:
github jacebrowning / gitman / tests / test_api.py View on Github external
def it_should_not_modify_config(config):
        gitman.update('gitman_1', depth=1)

        expect(config.datafile.text) == CONFIG
github jacebrowning / gitman / tests / test_api.py View on Github external
- name: gitman_2
          type: git
          repo: https://github.com/jacebrowning/gitman-demo
          sparse_paths:
          -
          rev: (old revision)
          link:
          scripts:
          -
        groups:
        -
        """
        )
        config.datafile.load()

        gitman.update(depth=1, force_interactive=True)

        expect(config.datafile.text) == strip(
            """
        location: deps
github jacebrowning / gitman / tests / test_api.py View on Github external
rev: example-branch
                - name: gitman_2
                  type: git
                  repo: https://github.com/jacebrowning/gitman-demo
                  rev: example-branch
                groups:
                - name: gitman_1
                  members:
                  - gitman_1
                  - gitman_2
            """
        )
        config.datafile.load()

        with pytest.raises(InvalidConfig):
            gitman.update(depth=1, lock=True)
github jacebrowning / gitman / tests / test_api.py View on Github external
def it_should_fail_on_dirty_repositories(config):
        expect(gitman.update(depth=1, lock=False)) == True
        shell.rm(os.path.join("deps", "gitman_1", ".project"))

        try:
            with pytest.raises(UncommittedChanges):
                gitman.lock()

            expect(config.datafile.text).does_not_contain("")

        finally:
            shell.rm(os.path.join("deps", "gitman_1"))
github jacebrowning / gitman / tests / test_api.py View on Github external
def it_records_specified_dependencies(config):
        expect(gitman.update(depth=1, lock=False)) == True
        expect(gitman.lock('gitman_1', 'gitman_3')) == True

        config.datafile.load()
        expect(config.datafile.text).contains(
            strip(
                """
        sources_locked:
github jacebrowning / gitman / tests / test_api.py View on Github external
- name: gitman_2
          type: git
          repo: https://github.com/jacebrowning/gitman-demo
          sparse_paths:
          -
          rev: (old revision)
          link:
          scripts:
          -
        groups:
        -
        """
        )
        config.datafile.load()

        gitman.update(depth=1, lock=False)

        expect(config.datafile.text) == strip(
            """
        location: deps
github jacebrowning / gitman / tests / test_api.py View on Github external
- name: gitman_2
          type: git
          repo: https://github.com/jacebrowning/gitman-demo
          sparse_paths:
          -
          rev: (old revision)
          link:
          scripts:
          -
        groups:
        -
        """
        )
        config.datafile.load()

        gitman.update(depth=1)

        config.datafile.load()
        expect(config.datafile.text) == strip(
            """
        location: deps
github jacebrowning / gitman / tests / test_api.py View on Github external
sparse_paths:
          -
          rev: (old revision)
          link:
          scripts:
          -
        groups:
        - name: group_a
          members:
          - gitman_1
          - gitman_2
        """
        )
        config.datafile.load()

        gitman.update('group_a', depth=1)

        config.datafile.load()
        expect(config.datafile.text) == strip(
            """
        location: deps