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

commit: improve qrefresh mode substantially

* You can refresh just a message change
* You can select changes from working dir or from
applied patch to be left out of refresh
* You can shelve changes to move them between patches

On the downside, there's no visual differentiation between
changes already in the patch and those in the working directory.
Should that matter? It's hard to say. Perhaps it shouldn't.

Changeset 4d0c4d45aea4

Parent 3a90eccc738e

by Steve Borho

Changes to 2 files · Browse files at 4d0c4d45aea4 Showing diff from parent 3a90eccc738e Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​commit.py Stacked
 
307
308
309
310
311
312
 
 
 
 
 
 
313
314
315
 
429
430
431
432
433
434
435
436
437
438
439
440
 
 
 
 
 
 
 
441
442
443
 
446
447
448
449
 
450
451
452
 
307
308
309
 
310
 
311
312
313
314
315
316
317
318
319
 
433
434
435
 
 
 
 
 
 
 
 
 
436
437
438
439
440
441
442
443
444
445
 
448
449
450
 
451
452
453
454
@@ -307,9 +307,13 @@
  dopatch = fp.tell()   fp.seek(0)   - # 3a. apply filtered patch to clean repo (clean)   if backups: - hg.revert(repo, repo.dirstate.parents()[0], backups.has_key) + if self.qheader is not None: + # 3a. apply filtered patch to top patch's parent + hg.revert(repo, self._node1, backups.has_key) + else: + # 3a. apply filtered patch to clean repo (clean) + hg.revert(repo, repo.dirstate.parents()[0], backups.has_key)     # 3b. (apply)   if dopatch: @@ -429,15 +433,13 @@
  # call the threaded CmdDialog to do the commit, so the the large commit   # won't get locked up by potential large commit. CmdDialog will also   # display the progress of the commit operation. - if self.qheader: - cmdline = ["hg", "qrefresh", "--verbose", "--repository", self.repo.root] - cmdline += ['--message', fromutf(self.opts['message'])] - else: - cmdline = ["hg", "commit", "--verbose", "--repository", self.repo.root] - if self.opts['addremove']: - cmdline += ['--addremove'] - cmdline += ['--message', fromutf(self.opts['message'])] - cmdline += [self.repo.wjoin(x) for x in files] + cmdline = ["hg", "commit", "--verbose", "--repository", self.repo.root] + if self.qheader is not None: + cmdline[1] = 'qrefresh' + if self.opts['addremove']: + cmdline += ['--addremove'] + cmdline += ['--message', fromutf(self.opts['message'])] + cmdline += [self.repo.wjoin(x) for x in files]   dialog = CmdDialog(cmdline, True)   dialog.set_transient_for(self)   dialog.run() @@ -446,7 +448,7 @@
  # refresh overlay icons and commit dialog   if dialog.return_code() == 0:   shell_notify([self.cwd] + files) - if not self.qheader: + if self.qheader is not None:   self.text.set_buffer(gtk.TextBuffer())   self._update_recent_messages(self.opts['message'])   self._last_commit_id = self._get_tip_rev(True)
Change 1 of 1 Show Entire File hggtk/​status.py Stacked
 
446
447
448
449
450
 
 
 
 
 
 
 
451
452
453
 
446
447
448
 
 
449
450
451
452
453
454
455
456
457
458
@@ -446,8 +446,13 @@
  # The following code was copied from the status function in mercurial\commands.py   # and modified slightly to work here   - # node2 is None (the working dir) when 0 or 1 rev is specificed - self._node1, self._node2 = cmdutil.revpair(self.repo, self.opts.get('rev')) + if hasattr(self.repo, 'mq') and self.repo.mq.applied: + # when a patch is applied, show diffs to parent of top patch + self._node1 = self.repo.lookup(-3) + self._node2 = None + else: + # node2 is None (the working dir) when 0 or 1 rev is specificed + self._node1, self._node2 = cmdutil.revpair(self.repo, self.opts.get('rev'))     matcher = cmdutil.match(self.repo, self.pats, self.opts)   cwd = (self.pats and self.repo.getcwd()) or ''