##// END OF EJS Templates
fetch: use cmdutil.bailifchanged()...
Martin von Zweigbergk -
r22676:a014fdc9 default
parent child Browse files
Show More
@@ -8,7 +8,7 b''
8 8 '''pull, update and merge in one command (DEPRECATED)'''
9 9
10 10 from mercurial.i18n import _
11 from mercurial.node import nullid, short
11 from mercurial.node import short
12 12 from mercurial import commands, cmdutil, hg, util, error
13 13 from mercurial.lock import release
14 14
@@ -48,7 +48,7 b" def fetch(ui, repo, source='default', **"
48 48 if date:
49 49 opts['date'] = util.parsedate(date)
50 50
51 parent, p2 = repo.dirstate.parents()
51 parent, _p2 = repo.dirstate.parents()
52 52 branch = repo.dirstate.branch()
53 53 try:
54 54 branchnode = repo.branchtip(branch)
@@ -58,19 +58,13 b" def fetch(ui, repo, source='default', **"
58 58 raise util.Abort(_('working dir not at branch tip '
59 59 '(use "hg update" to check out branch tip)'))
60 60
61 if p2 != nullid:
62 raise util.Abort(_('outstanding uncommitted merge'))
63
64 61 wlock = lock = None
65 62 try:
66 63 wlock = repo.wlock()
67 64 lock = repo.lock()
68 mod, add, rem, del_ = repo.status()[:4]
69 65
70 if mod or add or rem:
71 raise util.Abort(_('outstanding uncommitted changes'))
72 if del_:
73 raise util.Abort(_('working directory is missing some files'))
66 cmdutil.bailifchanged(repo)
67
74 68 bheads = repo.branchheads(branch)
75 69 bheads = [head for head in bheads if len(repo[head].children()) == 0]
76 70 if len(bheads) > 1:
@@ -150,7 +150,7 b' should merge f into g'
150 150 should abort, because i is modified
151 151
152 152 $ hg --cwd i fetch ../h
153 abort: working directory is missing some files
153 abort: uncommitted changes
154 154 [255]
155 155
156 156 test fetch with named branches
General Comments 0
You need to be logged in to leave comments. Login now