Commits

Anonymous committed a3e4c5c

removed attic-finish

attic-finish is unnecessary; use
hg commit
to commit a change and
hg unshelve --delete
to stop managing a patch in attic

  • Participants
  • Parent commits 9036382

Comments (0)

Files changed (4)

 attic-display (attic, ls):
     list the patches in the attic
     
-attic-finish (sfinish):
-    change a patch into a changeset (use commit, user and date info
-    from patch)
-    
 attic-current (sactive):
     display the current patch being worked on
      
     s.apply(repo, name, sim, opts)
     s.persiststate()
     repo.ui.status(_('Patch %s unshelved\n') % (s.applied))
-    
+    if opts['delete']:
+        s.remove(name)
+        repo.ui.status(_('patch removed\n'))
+        s.resetdefault()
+
 def listattic(ui, repo, **opts):
     """lists the available patches in the attic"""
     available = repo.attic.available()
     if len(available) > 0:
         repo.ui.write("\n")
 
-def sfinish(ui, repo, **opts):
-    """turns an applied patch into a changeset"""
-    s = repo.attic
-    name=s.applied
-    if not name:
-        raise util.Abort(_("no patch active"))
-    makepatch(ui, repo, name, [], opts)
-    if not opts['nocommit']:
-        (m, comments, u, d, hasdiff, gitdiff) = s.readheaders(name)
-        commands.commit(ui, repo, message="\n".join(m), logfile=None,
-                        user=u, date=d)
-                           
-    repo.ui.status(_('patch committed\n'))
-    if not opts['keep']:
-        s.remove(name)
-        repo.ui.status(_('patch removed\n'))
-    s.resetdefault()
-
 def sactive(ui, repo, **opts):
     """lists the current active patch"""
     s = repo.attic
         listattic, [], 
         _('hg attic-display')),
     
-    "attic-finish|sfinish": (
-        sfinish, [
-            ('n', 'nocommit', None,_('do not commit')),
-            ('e', 'edit', None, _('edit commit message')),
-            ('k', 'keep', None, _('keep patch file'))
-            ] + commands.commitopts + headeropts, 
-        _('hg attic-finish [options]')),
-    
     "attic-current|sactive": (
         sactive, [
             ('d', 'header', None, _('display patch header information'))], 
         unshelve, [
             ('f', 'force', None, _('force patch over existing changes')),
             ('n', 'dry-run', None,_('do not add or remove, just print output')),
+            ('', 'delete', None,_('delete the patch from the attic while unshelving it')),
             ('s', 'similarity', '',_('guess renamed files by similarity (0<=s<=100)'))],
         _('hg attic-unshelve [-f] [-n] [-s #] [name]')),
     

File tests/test-finish.bat

 call hg st
 call hg shelve --git -q a
 call hg unshelve -q
-echo ### hg sfinish -m "commit message"
-call hg sfinish -m "commit message"
-echo ### hg log --template "{rev} {desc} {files}\n"
-call hg log --template "{rev} {desc} {files}\n"
-
-echo b >> a.txt
-call hg shelve --git -q -m "commit message 2" a
-call hg unshelve -q
-echo ### hg sfinish
-call hg sfinish
+echo ### hg ci -m "commit message"
+call hg ci -m "commit message"
 echo ### hg log --template "{rev} {desc} {files}\n"
 call hg log --template "{rev} {desc} {files}\n"
 

File tests/test-finish.out

  adding a.txt
 A a.txt
-### hg sfinish -m "commit message"
-patch committed
-patch removed
+### hg ci -m "commit message"
 ### hg log --template "{rev} {desc} {files}\n"
 0 commit message a.txt
-### hg sfinish
-patch committed
-patch removed
-### hg log --template "{rev} {desc} {files}\n"
-1 commit message 2 a.txt
-0 commit message a.txt
 ### hg ci
 ### hg log --template "{rev} {desc} {files}\n"
-2 commit message 3 a.txt
-1 commit message 2 a.txt
+1 commit message 3 a.txt
 0 commit message a.txt
 ### hg ci -m "commit message 5"
 ### hg log --template "{rev} {desc} {files}\n"
-3 commit message 5 a.txt
-2 commit message 3 a.txt
-1 commit message 2 a.txt
+2 commit message 5 a.txt
+1 commit message 3 a.txt
 0 commit message a.txt

File tests/test-hgattic.out

 attic-display (attic, ls):
     list the patches in the attic
     
-attic-finish (sfinish):
-    change a patch into a changeset (use commit, user and date info
-    from patch)
-    
 attic-current (sactive):
     display the current patch being worked on
      
 
  attic-current    lists the current active patch
  attic-display    lists the available patches in the attic
- attic-finish     turns an applied patch into a changeset
  attic-rebuild    rebuilds the current active patch with the current changes
  attic-shelve     saves a patch to the attic from the current changes and removes them from the working copy
  attic-unshelve   activates a patch from the attic