33
33
User-Agent: Bazaar \(.*\)
35
35
-----BEGIN PSEUDO-SIGNED CONTENT-----
36
star-merge .*/public/ http://example.com/submit
36
star-merge .*/public/ .*/submit/
37
37
-----END PSEUDO-SIGNED CONTENT-----
243
243
def test_find_submit_branch(self):
244
244
source_branch = self.make_branch('source')
245
source_branch.set_submit_branch('http://example.com/submit')
245
submit_transport = self.get_transport().clone('submit')
246
submit_transport.ensure_base()
247
source_branch.set_submit_branch(submit_transport.base)
247
249
submission = pqm_submit.PQMSubmission(
248
250
source_branch=source_branch,
249
251
public_location='public-branch',
250
252
message='commit message')
251
self.assertEqual('http://example.com/submit',
252
submission.submit_location)
253
self.assertEqual(submit_transport.base, submission.submit_location)
254
255
def test_find_submit_branch_from_pqm_branch(self):
255
256
# Test that submit_branch can be picked up from the obsolete
256
257
# pqm_branch config option.
257
258
source_branch = self.make_branch('source')
259
submit_transport = self.get_transport().clone('submit')
260
submit_transport.ensure_base()
258
261
source_branch.get_config().set_user_option(
259
'pqm_branch', 'http://example.com/submit')
262
'pqm_branch', submit_transport.base)
260
263
# pqm_branch is used in preference to the submit_branch:
261
264
source_branch.set_submit_branch('bad-value')
264
267
source_branch=source_branch,
265
268
public_location='public-branch',
266
269
message='commit message')
267
self.assertEqual('http://example.com/submit',
268
submission.submit_location)
270
self.assertEqual(submit_transport.base, submission.submit_location)
270
272
def test_find_submit_branch_missing(self):
271
273
source_branch = self.make_branch('source')
317
319
source_branch = self.make_branch('source')
318
320
public_branch = self.make_branch('public')
319
321
source_branch.set_public_branch(public_branch.base)
320
source_branch.set_submit_branch('http://example.com/submit')
322
submit_transport = self.get_transport().clone('submit')
323
submit_transport.ensure_base()
324
source_branch.set_submit_branch(submit_transport.base)
321
325
config = source_branch.get_config()
322
326
config.set_user_option('pqm_email', 'PQM <pqm@example.com>')
323
327
config.set_user_option(
352
356
public_branch = self.make_branch('public')
353
357
source_tree.branch.set_public_branch(public_branch.base)
354
source_tree.branch.set_submit_branch('http://example.com/submit')
358
submit_transport = self.get_transport().clone('submit')
359
submit_transport.ensure_base()
360
source_tree.branch.set_submit_branch(submit_transport.base)
355
361
config = source_tree.branch.get_config()
356
362
config.set_user_option('pqm_email', 'PQM <pqm@example.com>')
357
363
config.set_user_option(
364
370
self.assertContainsRe(err,
365
r'Working tree ".*/source/" has uncommitted changes\.')
371
r'Working tree ".*/source/" has uncommitted changes')
367
373
def test_submit_subdir_of_branch(self):
368
374
source_branch = self.make_branch('source')
388
394
(out, err, connect_calls,
389
395
sendmail_calls) = self.run_bzr_fakemail(
390
396
['pqm-submit', '-m', 'commit message',
391
'--submit-branch', 'http://example.com/submit',
397
'--submit-branch', 'http://example.com/submit/',
394
400
self.assertEqual('', out)