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):
1737
1756
class cmd_missing(Command):
1738
"""What is missing in this branch relative to other branch.
1740
# TODO: rewrite this in terms of ancestry so that it shows only
1743
takes_args = ['remote?']
1744
aliases = ['mis', 'miss']
1745
takes_options = ['verbose']
1748
def run(self, remote=None, verbose=False):
1749
from bzrlib.errors import BzrCommandError
1750
from bzrlib.missing import show_missing
1752
if verbose and is_quiet():
1753
raise BzrCommandError('Cannot pass both quiet and verbose')
1755
tree = WorkingTree.open_containing(u'.')[0]
1756
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:
1759
1783
raise BzrCommandError("No missing location known or specified.")
1762
print "Using last location: %s" % parent
1764
elif parent is None:
1765
# We only update parent if it did not exist, missing
1766
# should not change the parent
1767
tree.branch.set_parent(remote)
1768
br_remote = Branch.open_containing(remote)[0]
1769
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)
1773
1817
class cmd_plugins(Command):