Changeset 429 in tailor


Ignore:
Timestamp:
07/25/05 23:51:54 (8 years ago)
Author:
lele@…
Hash name:
20050725215154-97f81-40c2a3994b65a80a7459f0faaa3dc06b7502b5e8
Message:

When properly setup even svn can have real timestamps and authors

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • vcpx/svn.py

    r427 r429  
    311311            log.write('\n') 
    312312            log.write(changelog.encode(encoding)) 
    313         log.write("\n\nOriginal author: %s\nDate: %s\n" % ( 
    314             author.encode(encoding), date)) 
     313 
     314        # If we cannot use propset, fall back to old behaviour of 
     315        # appending these info to the changelog 
     316         
     317        if not self.USE_PROPSET: 
     318            log.write("\n\nOriginal author: %s\nDate: %s\n" % ( 
     319                author.encode(encoding), date)) 
     320 
    315321        log.close()             
    316322 
     
    322328             
    323329        commit.execute(entries) 
    324          
     330 
     331        if self.USE_PROPSET: 
     332            cmd = [SVN_CMD, "propset", "%(propname)s", 
     333                   "--quiet", "--revprop", "-rHEAD"] 
     334            propset = ExternalCommand(cwd=root, command=cmd) 
     335 
     336            propset.execute(date.isoformat()+".000000Z", propname='svn:date') 
     337            propset.execute(author, propname='svn:author') 
     338 
    325339    def _removePathnames(self, root, names): 
    326340        """ 
  • vcpx/tailor.py

    r426 r429  
    2222from source import InvocationError 
    2323from session import interactive 
     24from svn import SvnWorkingDir 
    2425 
    2526STATUS_FILENAME = 'tailor.info' 
     
    533534] 
    534535 
     536VC_SPECIFIC_OPTIONS = [ 
     537    make_option("--use-svn-propset", action="store_true", default=False, 
     538                help="Use 'svn propset' to set the real date and author of " 
     539                     "each commit, instead of appending these information to " 
     540                     "the changelog. This requires some tweaks on the SVN " 
     541                     "repository to enable revision propchanges."), 
     542] 
     543                 
    535544class ExistingProjectError(Exception): 
    536545    "Project seems already tailored" 
     
    566575    upoptions = OptionGroup(parser, "Update options") 
    567576    upoptions.add_options(UPDATE_OPTIONS) 
     577 
     578    vcoptions = OptionGroup(parser, "VC specific options") 
     579    vcoptions.add_options(VC_SPECIFIC_OPTIONS) 
    568580     
    569581    parser.add_option_group(bsoptions) 
    570582    parser.add_option_group(upoptions) 
     583    parser.add_option_group(vcoptions) 
    571584     
    572585    options, args = parser.parse_args() 
     
    588601    Changeset.REFILL_MESSAGE = not options.dont_refill_changelogs 
    589602 
     603    SvnWorkingDir.USE_PROPSET = options.use_svn_propset 
     604     
    590605    if options.interactive: 
    591606        interactive(options, args) 
  • README

    r428 r429  
    103103 
    104104      $ tailor -D -v $HOME/svnwc/cmfcore 
    105        
     105 
     106   .. note:: In the step a) above, you may want to install an 
     107             appropriate hook in the repository to enable the 
     108             propset command to operate on unversioned properties, 
     109             as described in the `svn manual`__. Then you can 
     110             specify '--use-svn-propset' option, and tailor will 
     111             put the original author and timestamp in the proper 
     112             svn metadata instead of appending them to the changelog. 
     113 
     114             Beware: there is a note__ that revisions have to be 
     115             sorted in date order! This means that, if you have an 
     116             existing subversion repository, you can't really add in 
     117             another project.  The dates would all be interwined. 
     118             You would basically have to recreate the repo.  You can 
     119             work around this by using separate repos. 
     120 
     121__ http://svnbook.red-bean.com/en/1.0/ch05s02.html#svn-ch-5-sect-2.1 
     122__ http://svn.haxx.se/users/archive-2004-05/0245.shtml 
     123    
     124    
    1061253. Showing each command bootstrap a new DARCS repos in 
    107126   "~/darcs/cmftopic" under which the upstream module will be 
Note: See TracChangeset for help on using the changeset viewer.