213
217
implicitly add the parent, and so on up to the root. This means
214
218
you should never need to explictly add a directory, they'll just
215
219
get added when you add a file in the directory.
221
--dry-run will show which files would be added, but not actually
217
224
takes_args = ['file*']
218
takes_options = ['no-recurse']
220
def run(self, file_list, no_recurse=False):
221
from bzrlib.add import smart_add, add_reporter_print, add_reporter_null
223
reporter = add_reporter_null
225
takes_options = ['no-recurse', 'dry-run']
227
def run(self, file_list, no_recurse=False, dry_run=False):
232
# This is pointless, but I'd rather not raise an error
233
action = bzrlib.add.add_action_null
235
action = bzrlib.add.add_action_print
237
action = bzrlib.add.add_action_add
225
reporter = add_reporter_print
226
smart_add(file_list, not no_recurse, reporter)
239
action = bzrlib.add.add_action_add_and_print
241
bzrlib.add.smart_add(file_list, not no_recurse, action)
229
244
class cmd_mkdir(Command):
1247
1266
unchanged=False, strict=False):
1248
1267
from bzrlib.errors import (PointlessCommit, ConflictsInTree,
1249
1268
StrictCommitFailed)
1250
from bzrlib.msgeditor import edit_commit_message
1269
from bzrlib.msgeditor import edit_commit_message, \
1270
make_commit_message_template
1251
1271
from bzrlib.status import show_status
1252
1272
from tempfile import TemporaryFile
1275
# TODO: Need a blackbox test for invoking the external editor; may be
1276
# slightly problematic to run this cross-platform.
1255
1278
# TODO: do more checks that the commit will succeed before
1256
1279
# spending the user's valuable time typing a commit message.
1733
1756
class cmd_missing(Command):
1734
"""What is missing in this branch relative to other branch.
1736
# TODO: rewrite this in terms of ancestry so that it shows only
1739
takes_args = ['remote?']
1740
aliases = ['mis', 'miss']
1741
takes_options = ['verbose']
1744
def run(self, remote=None, verbose=False):
1745
from bzrlib.errors import BzrCommandError
1746
from bzrlib.missing import show_missing
1748
if verbose and is_quiet():
1749
raise BzrCommandError('Cannot pass both quiet and verbose')
1751
tree = WorkingTree.open_containing(u'.')[0]
1752
parent = tree.branch.get_parent()
1757
"""Show unmerged/unpulled revisions between two branches.
1759
OTHER_BRANCH may be local or remote."""
1760
takes_args = ['other_branch?']
1761
takes_options = [Option('reverse', 'Reverse the order of revisions'),
1763
'Display changes in the local branch only'),
1764
Option('theirs-only',
1765
'Display changes in the remote branch only'),
1773
def run(self, other_branch=None, reverse=False, mine_only=False,
1774
theirs_only=False, long=True, short=False, line=False,
1775
show_ids=False, verbose=False):
1776
from bzrlib.missing import find_unmerged, iter_log_data
1777
from bzrlib.log import log_formatter
1778
local_branch = bzrlib.branch.Branch.open_containing(".")[0]
1779
parent = local_branch.get_parent()
1780
if other_branch is None:
1781
other_branch = parent
1782
if other_branch is None:
1755
1783
raise BzrCommandError("No missing location known or specified.")
1758
print "Using last location: %s" % parent
1760
elif parent is None:
1761
# We only update parent if it did not exist, missing
1762
# should not change the parent
1763
tree.branch.set_parent(remote)
1764
br_remote = Branch.open_containing(remote)[0]
1765
return show_missing(tree.branch, br_remote, verbose=verbose,
1784
print "Using last location: " + local_branch.get_parent()
1785
remote_branch = bzrlib.branch.Branch.open(other_branch)
1786
local_extra, remote_extra = find_unmerged(local_branch, remote_branch)
1787
log_format = get_log_format(long=long, short=short, line=line)
1788
lf = log_formatter(log_format, sys.stdout,
1790
show_timezone='original')
1791
if reverse is False:
1792
local_extra.reverse()
1793
remote_extra.reverse()
1794
if local_extra and not theirs_only:
1795
print "You have %d extra revision(s):" % len(local_extra)
1796
for data in iter_log_data(local_extra, local_branch, verbose):
1798
printed_local = True
1800
printed_local = False
1801
if remote_extra and not mine_only:
1802
if printed_local is True:
1804
print "You are missing %d revision(s):" % len(remote_extra)
1805
for data in iter_log_data(remote_extra, remote_branch, verbose):
1807
if not remote_extra and not local_extra:
1809
print "Branches are up to date."
1812
if parent is None and other_branch is not None:
1813
local_branch.set_parent(other_branch)
1769
1817
class cmd_plugins(Command):