Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7, 0.7.1, and 0.7.2

hgshelve: allow shelve of qdiff changes for applied patches

Equivalent record functionality is in commit dialog

Changeset e2ca749154c3

Parent a5bf6f6e90cf

by Steve Borho

Changes to one file · Browse files at e2ca749154c3 Showing diff from parent a5bf6f6e90cf Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​hgshelve.py Stacked
 
397
398
399
 
 
 
 
 
 
400
401
402
403
404
405
 
 
406
407
408
 
448
449
450
451
 
452
453
454
 
397
398
399
400
401
402
403
404
405
406
407
408
409
 
 
410
411
412
413
414
 
454
455
456
 
457
458
459
460
@@ -397,12 +397,18 @@
  raise util.Abort(_('shelve data already exists'))     def shelvefunc(ui, repo, message, match, opts): + # If an MQ patch is applied, consider all qdiff changes + if hasattr(repo, 'mq') and repo.mq.applied: + basenode = self.repo.lookup(-3) + else: + basenode = repo.dirstate.parents()[0] +   changes = repo.status(match=match)[:5]   modified, added, removed = changes[:3]   files = modified + added + removed   diffopts = mdiff.diffopts(git=True, nodates=True) - patch_diff = ''.join(patch.diff(repo, repo.dirstate.parents()[0], - match=match, changes=changes, opts=diffopts)) + patch_diff = ''.join(patch.diff(repo, basenode, match=match, + changes=changes, opts=diffopts))     fp = cStringIO.StringIO(patch_diff)   ac = parsepatch(fp) @@ -448,7 +454,7 @@
  try:   # 3a. apply filtered patch to clean repo (clean)   if backups: - hg.revert(repo, repo.dirstate.parents()[0], backups.has_key) + hg.revert(repo, basenode, backups.has_key)     # 3b. apply filtered patch to clean repo (apply)   if dopatch: