File: test.py

package info (click to toggle)
frescobaldi 3.3.0%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 24,216 kB
  • sloc: python: 39,014; javascript: 263; sh: 238; makefile: 80
file content (28 lines) | stat: -rw-r--r-- 963 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Test file to test and demonstrate the API for the vcs module.



from vcs import app_repo

print('Debugging the git module')
print('List of remotes:')
print(app_repo.remotes())
print('List of branches (local):')
print(app_repo.branches())
print('List of branches(incl. remotes):')
print(app_repo.branches(False))
print()
print('List of branches with tracked remotes:')
for branch in app_repo.branches():
    print(branch, app_repo.tracked_remote_label(branch))
print('Current branch:')
print(app_repo.current_branch())
if app_repo.has_branch('master'):
    if app_repo.has_remote_branch('master'):
        remote, rem_branch = app_repo.tracked_remote('master')
        print('master has remote: ', remote, rem_branch)
    else:
        print('master doesn\'t have a remote branch')
print('has remote dummy:', app_repo.has_remote('dummy'))
print('has remote origin:', app_repo.has_remote('origin'))
print('has remote upstream:', app_repo.has_remote('upstream'))