Skip to content

Commit 1df81b3

Browse files
committed
change config key 'repo' is now 'url'
1 parent ff2b724 commit 1df81b3

File tree

7 files changed

+40
-39
lines changed

7 files changed

+40
-39
lines changed

examples/christmas-tree.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
docutils: svn+http://svn.code.sf.net/p/docutils/code/trunk
66
~/github_projects/:
77
kaptan:
8-
repo: git+https://github.com/emre/kaptan
8+
url: git+https://github.com/emre/kaptan
99
remotes:
1010
upstream: git+https://github.com/emre/kaptan
1111
marksteve: git+https://github.com/marksteve/kaptan.git
1212
tony: [email protected]:tony/kaptan.git
1313
~:
1414
.vim:
15-
repo: [email protected]:tony/vim-config.git
15+
url: [email protected]:tony/vim-config.git
1616
.tmux:
17-
repo: [email protected]:tony/tmux-config.git
17+
url: [email protected]:tony/tmux-config.git

examples/remotes.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
~/workspace/:
22
kaptan:
3-
repo: git+https://github.com/emre/kaptan
3+
url: git+https://github.com/emre/kaptan
44
remotes:
55
upstream: git+https://github.com/emre/kaptan
66
marksteve: git+https://github.com/marksteve/kaptan.git

vcspull/config.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ def expand_config(config):
6868
6969
to
7070
71-
repo_name: { repo: 'http://myrepo.com/repo.git' }
71+
repo_name: { url: 'http://myrepo.com/repo.git' }
7272
7373
also assures the repo is a :py:class:`dict`.
7474
'''
7575

7676
if isinstance(repo_data, string_types):
77-
config[directory][repo] = {'repo': repo_data}
77+
config[directory][repo] = {'url': repo_data}
7878

7979
'''
8080
``shell_command_after``: if str, turn to list.
@@ -226,14 +226,14 @@ def load_configs(configs):
226226
if repo_name in configdict[path]:
227227
if newconfigdict[path][repo_name] != configdict[path][repo_name]:
228228
print('same path + repo for %s' % repo_name)
229-
if newconfigdict[path][repo_name]['repo'] != configdict[path][repo_name]['repo']:
229+
if newconfigdict[path][repo_name]['url'] != configdict[path][repo_name]['url']:
230230
msg = (
231231
'same path + repo, different vcs (%s)\n'
232232
'%s\n%s' %
233233
(
234234
repo_name,
235-
configdict[path][repo_name]['repo'],
236-
newconfigdict[path][repo_name]['repo']
235+
configdict[path][repo_name]['url'],
236+
newconfigdict[path][repo_name]['url']
237237
)
238238
)
239239
raise Exception(msg)

vcspull/testsuite/config.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,23 @@ def setUp(self):
120120
ConfigTestCase.setUp(self)
121121
ConfigTestMixin.setUp(self)
122122

123-
config_yaml = """
123+
path_ = """
124124
'~/study/':
125125
sphinx: hg+file://{hg_repo_path}
126126
docutils: svn+file://{svn_repo_path}
127127
linux: git+file://{git_repo_path}
128128
'${HOME}/github_projects/':
129129
kaptan:
130-
repo: git+file://{git_repo_path}
130+
url: git+file://{git_repo_path}
131131
remotes:
132132
test_remote: git+file://{git_repo_path}
133133
'~':
134134
.vim:
135-
repo: git+file://{git_repo_path}
135+
url: git+file://{git_repo_path}
136136
.tmux:
137-
repo: git+file://{git_repo_path}
137+
url: git+file://{git_repo_path}
138138
"""
139+
config_yaml = path_
139140

140141
config_json = """
141142
{
@@ -146,7 +147,7 @@ def setUp(self):
146147
},
147148
"${HOME}/github_projects/": {
148149
"kaptan": {
149-
"repo": "git+file://${git_repo_path}",
150+
"url": "git+file://${git_repo_path}",
150151
"remotes": {
151152
"test_remote": "git+file://${git_repo_path}"
152153
}
@@ -486,15 +487,15 @@ def setUp(self):
486487
config_yaml3 = """
487488
{TMP_DIR}/srv/www/test/:
488489
subRepoDiffVCS:
489-
repo: svn+file://${svn_repo_path}
490+
url: svn+file://${svn_repo_path}
490491
subRepoSameVCS: git+file://${git_repo_path}
491492
vcsOn1: svn+file://${svn_repo_path}
492493
"""
493494

494495
config_yaml4 = """
495496
{TMP_DIR}/srv/www/test/:
496497
subRepoDiffVCS:
497-
repo: git+file://${git_repo_path}
498+
url: git+file://${git_repo_path}
498499
subRepoSameVCS: git+file://${git_repo_path}
499500
vcsOn2: svn+file://${svn_repo_path}
500501
"""

vcspull/testsuite/helpers.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,16 @@ def _seedConfigExampleMixin(self):
9393
docutils: svn+http://svn.code.sf.net/p/docutils/code/trunk
9494
{TMP_DIR}/github_projects/:
9595
kaptan:
96-
repo: [email protected]:tony/kaptan.git
96+
url: [email protected]:tony/kaptan.git
9797
remotes:
9898
upstream: git+https://github.com/emre/kaptan
9999
marksteve: git+https://github.com/marksteve/kaptan.git
100100
{TMP_DIR}:
101101
.vim:
102-
repo: [email protected]:tony/vim-config.git
102+
url: [email protected]:tony/vim-config.git
103103
shell_command_after: ln -sf /home/tony/.vim/.vimrc /home/tony/.vimrc
104104
.tmux:
105-
repo: [email protected]:tony/tmux-config.git
105+
url: [email protected]:tony/tmux-config.git
106106
shell_command_after:
107107
- ln -sf /home/tony/.tmux/.tmux.conf /home/tony/.tmux.conf
108108
"""
@@ -116,7 +116,7 @@ def _seedConfigExampleMixin(self):
116116
},
117117
'{TMP_DIR}/github_projects/'.format(TMP_DIR=self.TMP_DIR): {
118118
'kaptan': {
119-
'repo': '[email protected]:tony/kaptan.git',
119+
'url': '[email protected]:tony/kaptan.git',
120120
'remotes': {
121121
'upstream': 'git+https://github.com/emre/kaptan',
122122
'marksteve': 'git+https://github.com/marksteve/kaptan.git'
@@ -125,11 +125,11 @@ def _seedConfigExampleMixin(self):
125125
},
126126
'{TMP_DIR}'.format(TMP_DIR=self.TMP_DIR): {
127127
'.vim': {
128-
'repo': '[email protected]:tony/vim-config.git',
128+
'url': '[email protected]:tony/vim-config.git',
129129
'shell_command_after': 'ln -sf /home/tony/.vim/.vimrc /home/tony/.vimrc'
130130
},
131131
'.tmux': {
132-
'repo': '[email protected]:tony/tmux-config.git',
132+
'url': '[email protected]:tony/tmux-config.git',
133133
'shell_command_after': ['ln -sf /home/tony/.tmux/.tmux.conf /home/tony/.tmux.conf']
134134
}
135135
}
@@ -139,14 +139,14 @@ def _seedConfigExampleMixin(self):
139139

140140
config_dict_expanded = {
141141
'{TMP_DIR}/study/'.format(TMP_DIR=self.TMP_DIR): {
142-
'linux': {'repo': 'git+git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git', },
143-
'freebsd': {'repo': 'git+https://github.com/freebsd/freebsd.git', },
144-
'sphinx': {'repo': 'hg+https://bitbucket.org/birkenfeld/sphinx', },
145-
'docutils': {'repo': 'svn+http://svn.code.sf.net/p/docutils/code/trunk', },
142+
'linux': {'url': 'git+git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git', },
143+
'freebsd': {'url': 'git+https://github.com/freebsd/freebsd.git', },
144+
'sphinx': {'url': 'hg+https://bitbucket.org/birkenfeld/sphinx', },
145+
'docutils': {'url': 'svn+http://svn.code.sf.net/p/docutils/code/trunk', },
146146
},
147147
'{TMP_DIR}/github_projects/'.format(TMP_DIR=self.TMP_DIR): {
148148
'kaptan': {
149-
'repo': '[email protected]:tony/kaptan.git',
149+
'url': '[email protected]:tony/kaptan.git',
150150
'remotes': {
151151
'upstream': 'git+https://github.com/emre/kaptan',
152152
'marksteve': 'git+https://github.com/marksteve/kaptan.git'
@@ -155,11 +155,11 @@ def _seedConfigExampleMixin(self):
155155
},
156156
'{TMP_DIR}'.format(TMP_DIR=self.TMP_DIR): {
157157
'.vim': {
158-
'repo': '[email protected]:tony/vim-config.git',
158+
'url': '[email protected]:tony/vim-config.git',
159159
'shell_command_after': ['ln -sf /home/tony/.vim/.vimrc /home/tony/.vimrc']
160160
},
161161
'.tmux': {
162-
'repo': '[email protected]:tony/tmux-config.git',
162+
'url': '[email protected]:tony/tmux-config.git',
163163
'shell_command_after': ['ln -sf /home/tony/.tmux/.tmux.conf /home/tony/.tmux.conf']
164164
}
165165
}
@@ -340,13 +340,13 @@ def setUp(self):
340340
docutils: svn+file://{svn_repo_path}
341341
{TMP_DIR}/github_projects/deeper/:
342342
kaptan:
343-
repo: git+file://{git_repo_path}
343+
url: git+file://{git_repo_path}
344344
remotes:
345345
test_remote: git+file://{git_repo_path}
346346
{TMP_DIR}:
347347
samereponame: git+file://{git_repo_path}
348348
.tmux:
349-
repo: git+file://{git_repo_path}
349+
url: git+file://{git_repo_path}
350350
"""
351351

352352
config_json = """
@@ -357,7 +357,7 @@ def setUp(self):
357357
},
358358
"${TMP_DIR}/another_directory/": {
359359
"anotherkaptan": {
360-
"repo": "git+file://${git_repo_path}",
360+
"url": "git+file://${git_repo_path}",
361361
"remotes": {
362362
"test_remote": "git+file://${git_repo_path}"
363363
}
@@ -366,12 +366,12 @@ def setUp(self):
366366
"${TMP_DIR}": {
367367
"samereponame": "git+file://${git_repo_path}",
368368
".vim": {
369-
"repo": "git+file://${git_repo_path}"
369+
"url": "git+file://${git_repo_path}"
370370
}
371371
},
372372
"${TMP_DIR}/srv/www/": {
373373
"test": {
374-
"repo": "git+file://${git_repo_path}"
374+
"url": "git+file://${git_repo_path}"
375375
}
376376
}
377377
}

vcspull/testsuite/repo_object.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class EnsureMakeDirsRecursively(ConfigTestCase, RepoTestMixin,
168168

169169
YAML_CONFIG = """
170170
{TMP_DIR}/study/python:
171-
my_repo: svn+file://{REPO_DIR}
171+
my_url: svn+file://{REPO_DIR}
172172
"""
173173

174174
def test_makes_recursive(self):

vcspull/util.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ def expand_config(config):
6565
6666
to
6767
68-
repo_name: { repo: 'http://myrepo.com/repo.git' }
68+
repo_name: { url: 'http://myrepo.com/repo.git' }
6969
7070
also assures the repo is a :py:class:`dict`.
7171
'''
7272

7373
if isinstance(repo_data, string_types):
74-
config[directory][repo] = {'repo': repo_data}
74+
config[directory][repo] = {'url': repo_data}
7575

7676
'''
7777
``shell_command_after``: if str, turn to list.
@@ -115,14 +115,14 @@ def lookup_repos(config, dirmatch=None, vcsurlmatch=None, namematch=None):
115115
for repo, repo_data in repos.items():
116116
if dirmatch and not fnmatch.fnmatch(directory, dirmatch):
117117
continue
118-
if vcsurlmatch and not fnmatch.fnmatch(repo_data['repo'], vcsurlmatch):
118+
if vcsurlmatch and not fnmatch.fnmatch(repo_data['url'], vcsurlmatch):
119119
continue
120120
if namematch and not fnmatch.fnmatch(repo, namematch):
121121
continue
122122
repo_dict = {
123123
'name': repo,
124124
'cwd': directory,
125-
'url': repo_data['repo'],
125+
'url': repo_data['url'],
126126
}
127127

128128
if 'remotes' in repo_data:

0 commit comments

Comments
 (0)