Commits

ZyX_I  committed 499aec8

@%aurum/drivers/mercurial: Made rf-pull also update
@%aurum/drivers/subversion: Made rf-pull use “svn update”

  • Participants
  • Parent commits 02018ee

Comments (0)

Files changed (5)

File autoload/aurum/drivers/mercurial.vim

     elseif a:cmd is# 'push'
         let kwargs['new-branch']=1
     endif
+    if a:cmd is# 'pull'
+        let kwargs.update=1
+    endif
     return s:F.runcmd(a:repo, a:cmd, args, kwargs)
 endfunction
 "▶1 hg.push :: repo, dryrun, force[, URL[, rev]]

File autoload/aurum/drivers/subversion.vim

             \    'cif': 'Failed to commit changes to the repository %s: %s',
             \   'updf': 'Failed to update to revision %s '.
             \           'in the repository %s: %s',
+            \  'pullf': 'Failed to update repository %s: %s',
             \    'mvf': 'Failed to move file %s to %s in the repository %s: %s',
             \    'cpf': 'Failed to copy file %s to %s in the repository %s: %s',
             \    'rmf': 'Failed to remove file %s in the repository %s: %s',
         if type(a:1)==type(0)
             let kwargs.limit=''.a:1
         else
-            let kwargs.revision=a:1
+            let kwargs.revision=''.a:1
         endif
     elseif a:0==2
         let kwargs.revision=a:1.':'.a:2
         let kwargs.force=1
         let kwargs.accept='theirs-full'
     endif
-    let kwargs.revision=a:rev
+    let kwargs.revision=''.a:rev
     return s:F.svnm(a:repo, 'update', [], kwargs, 0, 'updf', a:rev)
 endfunction
 "▶1 svn.move :: repo, force, source, destination → + FS
     if a:dryrun
         return s:F.svnm(a:repo, 'log', [], {'revision': 'HEAD:BASE'}, 0)
     else
-        call s:_f.throw('pulnimp')
+        return s:F.svnm(a:repo, 'update', [], {'force': a:force}, 0, 'pullf')
     endif
 endfunction
 "▶1 svn.repo :: path → repo

File doc/aurum.txt

   pull :: dryrun, force[, url[, rev]] -> _                     *aurum-rf-pull*
     Push or pull to given or default URL. If {rev} argument is present, then 
     push/pull only this revision. {dryrun} designates that nothing should be 
-    actually done, only what will be done should be shown.
+    actually done, only what will be done should be shown. When pulling it 
+    also updates working directory (for consistency: only mercurial supports 
+    convenient pulls without updates).
     Note: unlike other functions, this should expect any possible revision 
-    specification.
+          specification.
     Note 2: if URL is a directory, it is supposed to be related to repository 
-    root, not to current working directory.
+            root, not to current working directory.
 The following functions do not accept repo argument:
   repo :: path -> repo                                         *aurum-rf-repo*
     Creates new repository object using repository located at given path.
     “subdir*/ignored*” will ignore all files with names starting with 
     “ignored” in a directory “subdir*”, which is probably not what you 
     initially wanted.
+|aurum-rf-pull| uses “svn update” to pull and “svn log” for incoming.
+|aurum-rf-push| is not defined.
 
 ==============================================================================
 11. Changelog                                                *aurum-changelog*

File plugin/aurum.vim

 "▶1 Global mappings
 " TODO mapping that closes status window
 call s:_f.mapgroup.add('Aurum', {
-            \'Commit':    {'lhs':  'i', 'rhs': ':<C-u>AuCommit<CR>'               },
-            \'CommitAll': {'lhs':  'I', 'rhs': ':<C-u>AuCommit all<CR>'           },
-            \'Open':      {'lhs':  'o', 'rhs': ':<C-u>AuFile<CR>'                 },
-            \'OpenAny':   {'lhs':  'O', 'rhs': ':<C-u>AuFile : : prompt<CR>'      },
-            \'Revert':    {'lhs': 'go', 'rhs': ':<C-u>AuFile : : replace<CR>'     },
-            \'Vdiff':     {'lhs':  'D', 'rhs': ':<C-u>AuVimDiff<CR>'              },
-            \'FVdiff':    {'lhs': 'gD', 'rhs': ':<C-u>AuVimDiff full<CR>'         },
-            \'Diff':      {'lhs':  'd', 'rhs': ':<C-u>AuDiff :<CR>'               },
-            \'Fdiff':     {'lhs': 'gd', 'rhs': ':<C-u>AuDiff<CR>'                 },
-            \'Annotate':  {'lhs':  'a', 'rhs': ':<C-u>AuAnnotate<CR>'             },
-            \'Status':    {'lhs':  's', 'rhs': ':<C-u>AuStatus|wincmd p<CR>'      },
-            \'Record':    {'lhs':  'r', 'rhs': ':<C-u>AuRecord<CR>'               },
-            \'Log':       {'lhs':  'L', 'rhs': ':<C-u>AuLog<CR>'                  },
-            \'LogFile':   {'lhs':  'l', 'rhs': ':<C-u>AuLog : files :<CR>'        },
-            \'URL':       {'lhs':  'H', 'rhs': ':<C-u>AuHyperlink<CR>'            },
-            \'LineURL':   {'lhs':  'h', 'rhs': ':<C-u>AuHyperlink line 0<CR>'     },
-            \'Track':     {'lhs':  'A', 'rhs': ':<C-u>AuTrack<CR>'                },
-            \'Forget':    {'lhs':  'R', 'rhs': ':<C-u>AuJunk forget :<CR>'        },
-            \'Push':      {'lhs':  'P', 'rhs': ':<C-u>AuOther push<CR>'           },
-            \'Pull':      {'lhs':  'p', 'rhs': ':<C-u>AuOther pull | AuUpdate<CR>'},
+            \'Commit':    {'lhs':  'i', 'rhs': ':<C-u>AuCommit<CR>'          },
+            \'CommitAll': {'lhs':  'I', 'rhs': ':<C-u>AuCommit all<CR>'      },
+            \'Open':      {'lhs':  'o', 'rhs': ':<C-u>AuFile<CR>'            },
+            \'OpenAny':   {'lhs':  'O', 'rhs': ':<C-u>AuFile : : prompt<CR>' },
+            \'Revert':    {'lhs': 'go', 'rhs': ':<C-u>AuFile : : replace<CR>'},
+            \'Vdiff':     {'lhs':  'D', 'rhs': ':<C-u>AuVimDiff<CR>'         },
+            \'FVdiff':    {'lhs': 'gD', 'rhs': ':<C-u>AuVimDiff full<CR>'    },
+            \'Diff':      {'lhs':  'd', 'rhs': ':<C-u>AuDiff :<CR>'          },
+            \'Fdiff':     {'lhs': 'gd', 'rhs': ':<C-u>AuDiff<CR>'            },
+            \'Annotate':  {'lhs':  'a', 'rhs': ':<C-u>AuAnnotate<CR>'        },
+            \'Status':    {'lhs':  's', 'rhs': ':<C-u>AuStatus|wincmd p<CR>' },
+            \'Record':    {'lhs':  'r', 'rhs': ':<C-u>AuRecord<CR>'          },
+            \'Log':       {'lhs':  'L', 'rhs': ':<C-u>AuLog<CR>'             },
+            \'LogFile':   {'lhs':  'l', 'rhs': ':<C-u>AuLog : files :<CR>'   },
+            \'URL':       {'lhs':  'H', 'rhs': ':<C-u>AuHyperlink<CR>'       },
+            \'LineURL':   {'lhs':  'h', 'rhs': ':<C-u>AuHyperlink line 0<CR>'},
+            \'Track':     {'lhs':  'A', 'rhs': ':<C-u>AuTrack<CR>'           },
+            \'Forget':    {'lhs':  'R', 'rhs': ':<C-u>AuJunk forget :<CR>'   },
+            \'Push':      {'lhs':  'P', 'rhs': ':<C-u>AuOther push<CR>'      },
+            \'Pull':      {'lhs':  'p', 'rhs': ':<C-u>AuOther pull<CR>'      },
         \}, {'mode': 'n', 'silent': 1, 'leader': '<Leader>a'})
 "▶1 Autocommands
 function s:F.aurun(...)

File test/cmd-other.ok

    @ Added a
    
 {{{1 A: default pull E from ^
-o  Changeset 5:5f59b65b87b3373b59ebd0b491332ffc149268d2 (branch E)
+@  Changeset 5:5f59b65b87b3373b59ebd0b491332ffc149268d2 (branch E)
 |  Commited 01 Jan 1990 00:00 by A
 |  Tags: tip
 |  @ Added branch E
 |/   Commited 01 Jan 1990 00:00 by A
 |    @ Added branch B
 |    
-| @  Changeset 1:a9ddcc9b20848f8d9b12d11379a3461aa1385476 (branch A)
+| o  Changeset 1:a9ddcc9b20848f8d9b12d11379a3461aa1385476 (branch A)
 |/   Commited 01 Jan 1990 00:00 by A
 |    @ Added branch A
 |    
 |  Tags: tip
 |  @ Added branch F
 |  
-| o  Changeset 5:5f59b65b87b3373b59ebd0b491332ffc149268d2 (branch E)
+| @  Changeset 5:5f59b65b87b3373b59ebd0b491332ffc149268d2 (branch E)
 |/   Commited 01 Jan 1990 00:00 by A
 |    @ Added branch E
 |    
 |/   Commited 01 Jan 1990 00:00 by A
 |    @ Added branch B
 |    
-| @  Changeset 1:a9ddcc9b20848f8d9b12d11379a3461aa1385476 (branch A)
+| o  Changeset 1:a9ddcc9b20848f8d9b12d11379a3461aa1385476 (branch A)
 |/   Commited 01 Jan 1990 00:00 by A
 |    @ Added branch A
 |    
    @ Added a
    
 {{{1 C: pull E from ^
-o  Changeset 5:5f59b65b87b3373b59ebd0b491332ffc149268d2 (branch E)
+@  Changeset 5:5f59b65b87b3373b59ebd0b491332ffc149268d2 (branch E)
 |  Commited 01 Jan 1990 00:00 by A
 |  Tags: tip
 |  @ Added branch E
 |/   Commited 01 Jan 1990 00:00 by A
 |    @ Added branch A
 |    
-@  Changeset 0:9c5c19d8e23488513c07f28024bdf574f4c9db6c
+o  Changeset 0:9c5c19d8e23488513c07f28024bdf574f4c9db6c
    Commited 01 Jan 1990 00:00 by A
    @ Added a
    
 |  Tags: tip
 |  @ Added branch F
 |  
-| o  Changeset 5:5f59b65b87b3373b59ebd0b491332ffc149268d2 (branch E)
+| @  Changeset 5:5f59b65b87b3373b59ebd0b491332ffc149268d2 (branch E)
 |/   Commited 01 Jan 1990 00:00 by A
 |    @ Added branch E
 |    
 |/   Commited 01 Jan 1990 00:00 by A
 |    @ Added branch A
 |    
-@  Changeset 0:9c5c19d8e23488513c07f28024bdf574f4c9db6c
+o  Changeset 0:9c5c19d8e23488513c07f28024bdf574f4c9db6c
    Commited 01 Jan 1990 00:00 by A
    @ Added a
    
 |  Tags: tip
 |  @ Added branch F
 |  
-| o  Changeset 5:5f59b65b87b3373b59ebd0b491332ffc149268d2 (branch E)
+| @  Changeset 5:5f59b65b87b3373b59ebd0b491332ffc149268d2 (branch E)
 |/   Commited 01 Jan 1990 00:00 by A
 |    @ Added branch E
 |    
 |/   Commited 01 Jan 1990 00:00 by A
 |    @ Added branch B
 |    
-| @  Changeset 1:a9ddcc9b20848f8d9b12d11379a3461aa1385476 (branch A)
+| o  Changeset 1:a9ddcc9b20848f8d9b12d11379a3461aa1385476 (branch A)
 |/   Commited 01 Jan 1990 00:00 by A
 |    @ Added branch A
 |    
 | |  Commited 01 Jan 1990 00:00 by A
 | |  @ Added branch F
 | |  
-| | o  Changeset 5:5f59b65b87b3373b59ebd0b491332ffc149268d2 (branch E)
+| | @  Changeset 5:5f59b65b87b3373b59ebd0b491332ffc149268d2 (branch E)
 | |/   Commited 01 Jan 1990 00:00 by A
 | |    @ Added branch E
 | |    
 | |/   Commited 01 Jan 1990 00:00 by A
 | |    @ Added branch B
 | |    
-| | @  Changeset 1:a9ddcc9b20848f8d9b12d11379a3461aa1385476 (branch A)
+| | o  Changeset 1:a9ddcc9b20848f8d9b12d11379a3461aa1385476 (branch A)
 | |/   Commited 01 Jan 1990 00:00 by A
 | |    @ Added branch A
 | |    
 | |  Commited 01 Jan 1990 00:00 by A
 | |  @ Added branch F
 | |  
-| | o  Changeset 5:5f59b65b87b3373b59ebd0b491332ffc149268d2 (branch E)
+| | @  Changeset 5:5f59b65b87b3373b59ebd0b491332ffc149268d2 (branch E)
 | |/   Commited 01 Jan 1990 00:00 by A
 | |    @ Added branch E
 | |    
 | |/   Commited 01 Jan 1990 00:00 by A
 | |    @ Added branch A
 | |    
-| @  Changeset 0:9c5c19d8e23488513c07f28024bdf574f4c9db6c
+| o  Changeset 0:9c5c19d8e23488513c07f28024bdf574f4c9db6c
 |    Commited 01 Jan 1990 00:00 by A
 |    @ Added a
 |