~siborgium/src-tree

dca16ef00ad3a333b496134631bc917b12761dd2 — Sergey Smirnykh 1 year, 3 months ago c8797cd trunk
Always fetch, fix command description
2 files changed, 8 insertions(+), 7 deletions(-)

M README.md
M src-tree
M README.md => README.md +4 -6
@@ 9,8 9,8 @@ It allows to clone multiple repositories as described by configuration file, and

```sh
% src-tree clone config.yaml --root ./root
% mkdir root/build
% # populate root/build with dependencies
% mkdir root/result
% # populate root/result with dependencies
% src-tree link config.yaml --root ./root --builddir build --targetdir result
```



@@ 32,11 32,9 @@ This would produce a following directory tree minus `xxx` and `zzz` contents.
./root/zzz/build -> ./root/result
```

Having applied some changes to the tree, you may want to synchronize it with the origin.
It can be done with
Sometimes the working tree gets dirty or stale.
You can fetch & checkout to the latest copy with

```sh
% src-tree checkout config.yaml
```

It would fetch changes from origin and checkout to them, optionally resetting any dirty files.

M src-tree => src-tree +4 -1
@@ 109,7 109,10 @@ class SrcTree(object):
                if args.force:
                    print(f'Setting origin url to \'{url}\'')
                    repo.remotes.origin.url = url
                    repo.remotes.origin.fetch()
                else:
                    raise Exception('Origin does not match the origin specified in configuration file')

            repo.remotes.origin.fetch()

            if branch not in repo.heads:
                print(f'Branch \'{dir.relative_to(Path.cwd())}:{branch}\' does not exist, creating')