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

history: use selected rev's parent as bundle base

hg bundle --base rev does not include the specified revision
in the bundle, which is counterintuitive from the way our GUI
works. So we use the rev's first parent as the base.

Changeset f8860383d3d0

Parent de3c2040b03c

by Steve Borho

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

Change 1 of 2 Show Entire File hggtk/​history.py Stacked
 
22
23
24
25
 
26
27
28
 
522
523
524
525
526
 
 
 
 
 
 
527
528
529
530
531
532
 
533
534
535
 
22
23
24
 
25
26
27
28
 
522
523
524
 
 
525
526
527
528
529
530
531
532
533
534
535
 
536
537
538
539
@@ -22,7 +22,7 @@
 from merge import MergeDialog  from vis import treemodel  from vis.treeview import TreeView -from hglib import toutf +from hglib import toutf, LookupError  import gtklib    def create_menu(label, callback): @@ -522,14 +522,18 @@
  success, outtext = self._hg_call_wrapper("Export",dohgexport,False)     def _bundle_rev_to_tip(self, menuitem): - rev = self.currow[treemodel.REVID] - filename = "%s_rev%s_to_tip.hg" % (os.path.basename(self.repo.root), rev) + try: + rev = int(self.currow[treemodel.REVID]) + parent = self.repo[rev].parents()[0].rev() + except (ValueError, LookupError): + return + filename = "%s_rev%d_to_tip.hg" % (os.path.basename(self.repo.root), rev)   result = NativeSaveFileDialogWrapper(Title = "Write bundle to",   InitialDir=self.repo.root,   FileName=filename).run()   if result:   from hgcmd import CmdDialog - cmdline = ['hg', 'bundle', '--base', str(rev), result] + cmdline = ['hg', 'bundle', '--base', str(parent), result]   dlg = CmdDialog(cmdline)   dlg.show_all()   dlg.run()