comparison hgext/mq.py @ 2531:7a90e0c77f43

Merge with crew.
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 30 Jun 2006 21:35:28 +0200
parents 37785f986260 e4deeaac5e74
children 8264c2034970
comparison
equal deleted inserted replaced
2530:d181845bdc51 2531:7a90e0c77f43
212 p1 = revlog.hex(pp[1]) 212 p1 = revlog.hex(pp[1])
213 if p0 in arevs: 213 if p0 in arevs:
214 return pp[0] 214 return pp[0]
215 if p1 in arevs: 215 if p1 in arevs:
216 return pp[1] 216 return pp[1]
217 return None
218 return pp[0] 217 return pp[0]
219 218
220 def mergepatch(self, repo, mergeq, series, wlock): 219 def mergepatch(self, repo, mergeq, series, wlock):
221 if len(self.applied) == 0: 220 if len(self.applied) == 0:
222 # each of the patches merged in will have two parents. This 221 # each of the patches merged in will have two parents. This
384 (c, a, r, d, u) = repo.changes(None, None) 383 (c, a, r, d, u) = repo.changes(None, None)
385 if c or a or d or r: 384 if c or a or d or r:
386 self.ui.write("Local changes found, refresh first\n") 385 self.ui.write("Local changes found, refresh first\n")
387 sys.exit(1) 386 sys.exit(1)
388 def new(self, repo, patch, msg=None, force=None): 387 def new(self, repo, patch, msg=None, force=None):
389 if not force: 388 commitfiles = []
390 self.check_localchanges(repo) 389 (c, a, r, d, u) = repo.changes(None, None)
390 if c or a or d or r:
391 if not force:
392 raise util.Abort(_("Local changes found, refresh first"))
393 else:
394 commitfiles = c + a + r
391 self.check_toppatch(repo) 395 self.check_toppatch(repo)
392 wlock = repo.wlock() 396 wlock = repo.wlock()
393 insert = self.series_end() 397 insert = self.series_end()
394 if msg: 398 if msg:
395 n = repo.commit([], "[mq]: %s" % msg, force=True, wlock=wlock) 399 n = repo.commit(commitfiles, "[mq]: %s" % msg, force=True,
396 else: 400 wlock=wlock)
397 n = repo.commit([], 401 else:
402 n = repo.commit(commitfiles,
398 "New patch: %s" % patch, force=True, wlock=wlock) 403 "New patch: %s" % patch, force=True, wlock=wlock)
399 if n == None: 404 if n == None:
400 self.ui.warn("repo commit failed\n") 405 self.ui.warn("repo commit failed\n")
401 sys.exit(1) 406 sys.exit(1)
402 self.full_series[insert:insert] = [patch] 407 self.full_series[insert:insert] = [patch]
410 p.write(msg) 415 p.write(msg)
411 p.close() 416 p.close()
412 wlock = None 417 wlock = None
413 r = self.qrepo() 418 r = self.qrepo()
414 if r: r.add([patch]) 419 if r: r.add([patch])
420 if commitfiles:
421 self.refresh(repo, short=True)
415 422
416 def strip(self, repo, rev, update=True, backup="all", wlock=None): 423 def strip(self, repo, rev, update=True, backup="all", wlock=None):
417 def limitheads(chlog, stop): 424 def limitheads(chlog, stop):
418 """return the list of all nodes that have no children""" 425 """return the list of all nodes that have no children"""
419 p = {} 426 p = {}