Ticket #466: 5825.patch

File 5825.patch, 4.4 KB (added by pdehaye, 15 years ago)
  • sage/misc/hg.py

    # HG changeset patch
    # User Paul Dehaye <pauloliviersage@gmail.com>
    # Date 1187810218 -3600
    # Node ID 75e49984c0dc372e2a52ff43aee4c99cfc65216b
    # Parent  c955b6d7531fab609de18d91f29bd0e65e7c2096
    Fixed different options that were not quite right, also hg_sage.rename()
    
    diff -r c955b6d7531f -r 75e49984c0dc sage/misc/hg.py
    a b SAGE Interface to the HG/Mercurial Revis 
    33
    44These functions make setup and use of source control with SAGE easier, using
    55the distributed Mercurial HG source control system.  To learn about Mercurial,
    6 see http://www.selenic.com/mercurial/wiki/.
     6see http://www.selenic.com/mercurial/wiki/ , in particular UnderstandingMercurial .
    77
    88This system should all be fully usable from the SAGE notebook (except
    99for merging, currently).
    10 This system should all be mostly from the SAGE notebook.
     10This system should all be mostly usable from the SAGE notebook.
    1111
    1212\begin{itemize}
    1313\item Use \code{hg_sage.record()} to record all of your changes.
    class HG: 
    362362
    363363        INPUT:
    364364            files -- list or string; name of file or directory.
    365             options -- string
     365            options -- string  (e.g., '--dry-run')
    366366        """
    367367        if isinstance(files, str):
    368368            if ' ' in files:
    class HG: 
    392392
    393393    def rename(self, src, dest, options=''):
    394394        """
    395         Move (rename) the given file.
    396 
    397         INPUT:
    398             src, dest -- strings that define files, relative to self.dir()
     395        Move (rename) the given file, from src to dest.
     396        This command takes effect in the next commit.
     397
     398        INPUT:
     399            src, dest -- strings that define a file, relative to self.dir()
    399400            options --
    400401                 -A --after    record a rename that has already occurred
    401402                 -f --force    forcibly copy over an existing managed file
    402                  -I --include  include names matching the given patterns
    403                  -X --exclude  exclude names matching the given patterns
    404403                 -n --dry-run  do not perform actions, just print output           
    405404        """
    406         if isinstance(files, str):
    407             files = [files]
    408         for file in files:
    409             print "Moving %s --> %s"%file
    410             self('mv %s "%s"'%(options, file))
     405        print "Moving %s --> %s"%(src,dest)
     406        self('mv %s "%s" "%s"'%(options, src,dest))
     407
    411408
    412409    move = rename
    413410    mv = rename
    class HG: 
    456453            options += '-m '
    457454        if patch:
    458455            options += '-p "%s"'%patch
     456        if template:
     457            options += '--template'
    459458        if include:
    460459            options += '-I "%s"'%include
    461460        if exclude:
    class HG: 
    538537         -n --dry-run    do not perform actions, just print output
    539538        """
    540539        if not rev is None:
    541             options = ' -r %s %s'%(rev, files)
     540            options = options +' -r %s %s'%(rev, files)
    542541        else:
    543             options = files
     542            options = options + files
    544543        self('revert %s'%options)
    545544
    546545    def dir(self):
    class HG: 
    554553        Return the default 'master url' for this repository.
    555554        """
    556555        return self.__url
     556
    557557
    558558    def help(self, cmd=''):
    559559        r"""
    class HG: 
    671671        INPUT:
    672672            options -- default: ''
    673673                'tip' -- tip
    674                  -b --branch  merge with head of a specific branch
    675674                 -f --force   force a merge with outstanding changes
    676675        """
    677676        self('merge %s'%options)
    class HG: 
    696695
    697696        INPUT:
    698697            options -- string (default: '')
    699              -b --branch  checkout the head of a specific branch
    700              -C --clean   overwrite locally modified files
    701              -f --force   force a merge with outstanding changes
     698            -C --clean  overwrite locally modified files
     699            -d --date   tipmost revision matching date
     700            -r --rev    revision
    702701        """
    703702        self('update %s'%options)
    704703
    class HG: 
    718717
    719718        INPUT:
    720719            options -- string (default: '')
    721              -b --branches  show branches
    722720                --style     display using template map file
    723721             -r --rev       show only heads which are descendants of rev
    724722                --template  display with template