827
827
tree = WorkingTree.open_containing(dir)[0]
828
828
tree.lock_write()
830
existing_pending_merges = tree.pending_merges()
830
existing_pending_merges = tree.get_parent_ids()[1:]
831
831
last_rev = tree.last_revision()
832
832
if last_rev == tree.branch.last_revision():
833
833
# may be up to date, check master too.
839
839
conflicts = tree.update()
840
840
revno = tree.branch.revision_id_to_revno(tree.last_revision())
841
841
note('Updated to revision %d.' % (revno,))
842
if tree.pending_merges() != existing_pending_merges:
842
if tree.get_parent_ids()[1:] != existing_pending_merges:
843
843
note('Your local commits will now show as pending merges with '
844
844
"'bzr status', and can be committed with 'bzr commit'.")
845
845
if conflicts != 0:
2781
2781
sys.stdin.readline()
2784
class cmd_serve(Command):
2785
"""Run the bzr server.
2789
help='serve on stdin/out for use from inetd or sshd'),
2791
help='listen for connections on nominated port of the form '
2792
'[hostname:]portnumber. Passing 0 as the port number will '
2793
'result in a dynamically allocated port.',
2796
help='serve contents of directory',
2800
def run(self, port=None, inet=False, directory=None):
2801
from bzrlib.transport import smart
2802
from bzrlib.transport import get_transport
2803
if directory is None:
2804
directory = os.getcwd()
2805
t = get_transport(directory)
2807
server = smart.SmartStreamServer(sys.stdin, sys.stdout, t)
2808
elif port is not None:
2810
host, port = port.split(':')
2813
server = smart.SmartTCPServer(t, host=host, port=int(port))
2814
print 'listening on port: ', server.port
2817
raise BzrCommandError("bzr serve requires one of --inet or --port")
2784
2821
# command-line interpretation helper for merge-related commands
2785
2822
def merge(other_revision, base_revision,
2786
2823
check_clean=True, ignore_zero=False,