1344
1344
class cmd_branches(Command):
1345
1345
__doc__ = """List the branches available at the current location.
1347
This command will print the names of all the branches at the current location.
1347
This command will print the names of all the branches at the current
1350
1351
takes_args = ['location?']
1353
Option('recursive', short_name='R',
1354
help='Recursively scan for branches rather than '
1355
'just looking in the specified location.')]
1352
def run(self, location="."):
1353
dir = bzrdir.BzrDir.open_containing(location)[0]
1354
for branch in dir.list_branches():
1355
if branch.name is None:
1356
self.outf.write(gettext(" (default)\n"))
1358
self.outf.write(" %s\n" % branch.name.encode(self.outf.encoding))
1357
def run(self, location=".", recursive=False):
1359
t = transport.get_transport(location)
1360
if not t.listable():
1361
raise errors.BzrCommandError(
1362
"Can't scan this type of location.")
1363
for b in bzrdir.BzrDir.find_branches(t):
1364
self.outf.write("%s\n" % urlutils.unescape_for_display(
1365
urlutils.relative_url(t.base, b.base),
1366
self.outf.encoding).rstrip("/"))
1368
dir = bzrdir.BzrDir.open_containing(location)[0]
1369
for branch in dir.list_branches():
1370
if branch.name is None:
1371
self.outf.write(gettext(" (default)\n"))
1373
self.outf.write(" %s\n" % branch.name.encode(
1374
self.outf.encoding))
1361
1377
class cmd_checkout(Command):