create new tag
, view all tags

Ignoring updates to TWikiAdminGroup, Sandbox.WebHome

On SubversionBasedTWikiInstalls I am seeking to not take updates for Main.TWikiAdminGroup, etc.

   MartinCleaver   Hi all - can I use svn ignore to mean "never take/merge updates for fileX even if it has changed in SVN"?
   darix   !a MartinCleaver ignore commit
   ayita   MartinCleaver: http://subversion.tigris.org/faq.html#ignore-commit
   darix   in short ... NO
   MartinCleaver   clicks
   MartinCleaver   y. thought so
   MartinCleaver   that won't work for me
   MartinCleaver   is there a different workaround?>
   MartinCleaver   I guess I could wrap svn to take a copy of my local file, svn up, and restore my copy
   MartinCleaver   does such a wrapper already exist?
   darix   MartinCleaver: no
   darix   MartinCleaver: why do you want to keep the old version?
   MartinCleaver   the distro comes with files containing 1) members of a default group 2) default content for a certain page
   MartinCleaver   in both cases I need to ensure my versions stick
   darix   MartinCleaver: it wont overwrite it
   darix   it will merge upstream changes
   MartinCleaver   no it merges!
   MartinCleaver   I can't take the merges
   MartinCleaver   I want the upstream merges to be rejected
   darix   MartinCleaver: not possible
   darix   svn st -u
   darix   and just run svn update on all the other files
   MartinCleaver   is there an accepted way to write wrappers around svn?
   MartinCleaver   now I have to get a list of all the other files... but of course if something has been added I don't know what those files are to explicitly list the,
   MartinCleaver   them
   MartinCleaver   so that won't work
   MartinCleaver   I can invent arbitrary properties, can't I?
   MartinCleaver   so I could create a property that designated which files to not take updates for
   MartinCleaver   but... I guess these would get pushed to other users
   MartinCleaver   so that won't work
   MartinCleaver   I'll have to keep the information outside of SVN
   MartinCleaver   tries his question on #svn-dev
   MartinCleaver   thanks for your help darix
   darix   MartinCleaver: svn st -u
   darix   than a some awk magic
   darix   and run svn up on the files
   MartinCleaver   oh so -u will tell me all files...
   MartinCleaver   ok so that will give me the list...
   MartinCleaver   Can I use a binding to override behaviour of "svn up"?

On #svn-dev:

   MartinCleaver   is there an accepted way to write wrappers around svn?
   housel   you can write wrappers around the command-line svn, or you can roll your own using the libraries or the Perl/Python/Java/Ruby bindings
   MartinCleaver   Thanks housel - should I repeat the fuller context of my question that I just posed on #svn or did you read it already?
   housel   just now read it
   MartinCleaver   thanks
   MartinCleaver   so can I write a wrapper that will help me ignore the updates?
   MartinCleaver   I guess a binding would be cleaner
   MartinCleaver   but would it be hard for users to install on the client side?
   housel   not necessarily... most distributions package the Perl and Python bindings
   MartinCleaver   and it does not need admin privs?
   housel   to install bindings? generally it does, just like installing subversion
   MartinCleaver   ok, that won't work for many of our users who install on a hosting provider box
   MartinCleaver   so I guess it has to be a wrapper
   MartinCleaver   not ideal but at least I tried
   MartinCleaver   thanks
   MartinCleaver   thanks
   housel   a lot of hosting providers will have already installed the bindings, but one can never be sure
   MartinCleaver   oh... so to install a specific perl script that hooks into the binding though?
   MartinCleaver   does installing a specific perl script into the binding require admin privs?
   housel   no
   MartinCleaver   ok.
   MartinCleaver   hey, does every merge retain the .mine file? or is this only for conflicts?
   housel   just for conflicts
   MartinCleaver   shame ;)
   MartinCleaver   I guess filtering the list of files to be "svn up"ped is the easiest approach

   MartinCleaver   looks for the meaning of the revision number in the output of svn up -u
   MartinCleaver   discovers -u cannot be searched for by google so goes TRTFM
   MartinCleaver   OK. so if I read http://svnbook.red-bean.com/en/1.0/re26.html correctly, all "A newer revision of the item exists on the server." updates will have a * in the 8th column
   MartinCleaver   I can get the list of files that I would get from "svn up" with this, and filter out any I don't want...?
well when your own install needs a certain file always different to the default page it becomes a problem
   MartinCleaver   you get upstream changes relevant to the distribution but irrelevant for your installation
   MartinCleaver   in a SVN checkout dir, is it possible to disconnect your local copy from taking upstream changes? e.g. by removing the .svn directory?
   MartinCleaver   I tried it but it refused to update the rest of the hierarchy
   darix   MartinCleaver: svn up *
   darix   you should work
   MartinCleaver   ok, and is there a "svn up -except file1 dir2 dir3"?
   MartinCleaver   knows the answer to that one
   darix   no
   MartinCleaver   wins the prize
   darix   MartinCleaver: there is
   MartinCleaver   I guess "svn up *" won't work if I want the directory there but don't want it updated?
   darix   svn st -u | grep -v 'Status against revision' | perl -n -e 's|^.{20}||g; print' | grep -v $blacklist
   MartinCleaver   is this more fully documented elsewhere?
   darix   what do you mean?
   darix   the output of svn st -u?
   MartinCleaver   i.e. did you just make this command line up or is it on a website somewhere?
   darix   MartinCleaver: i just ran svn st -u on one of my WCs
   darix   than looked at the output and build up this cmdline
   MartinCleaver   ok. I understand - it gives you the list I need
   darix   you could do
   darix   svn up $(svn st -u | grep -v 'Status against revision' | perl -n -e 's|^.{20}||g; print' | grep -v $blacklist)
   MartinCleaver   I could use the filename form of grep too
   darix   MartinCleaver: you just need to extend the commandline with the grep -v for your blacklisted files
   MartinCleaver   is there a file form of svn up, so I can avoid listing the 2000 odd files on the command line?
   darix   and you would be done oO
   darix   file form?
   darix   what do you mean by file form?
   MartinCleaver   e.g. a way to do svn up `cat filestoupdate`
   MartinCleaver   without expanding them on the command line
   darix   err
   darix   you would need to create that file dynamically
   darix   oO
   darix   the above commandline does that
   darix   oO
   MartinCleaver   sure, but can svn up take a file listing the files to update
   MartinCleaver   or must it have it on the command line
   darix   in the commandline
   MartinCleaver   There is bound to be a limit to the number of files listable on the command line
   darix   as svn help update would have told you.
   darix   MartinCleaver: right
   darix   MartinCleaver: svn st -u | grep -v 'Status against revision' | perl -n -e 's|^.{20}||g; print' | grep -v $blacklist | xargs -r svn up
   MartinCleaver   so now I have to 1) batch 2) break up my transaction
   darix   ....
   MartinCleaver   this will invoke svn up (expensive) for each file?
   darix   no
   darix   man xargs
   MartinCleaver   thinks its been a while
   MartinCleaver   executes the command (default is /bin/echo) _one or more times_ with any initial-arguments
   MartinCleaver   I read that to mean it would run svn up once for each file listed through the pipe
   darix   normally it should create a commandline that is not longer than max
   MartinCleaver   I think it would run e.g. svn up file1;
   MartinCleaver   svn up file2;
   MartinCleaver   svn up file3
   MartinCleaver   svn up file4
   darix   hmm
   darix   no
   MartinCleaver   etc
   darix   but you would easily see it
   darix   and instead of thinking here you could just test it
   MartinCleaver   so you were right... somehow it calculates it
   MartinCleaver   neat
   MartinCleaver   thus minimizing the number of calls it makes
   darix   correct.
   darix   as expected
   MartinCleaver   doesn't actually say it minimizes it in the synopsis
   MartinCleaver   but am glad it does
   MartinCleaver   ok...
   darix   MartinCleaver: it isnt hard to do that code.
   MartinCleaver   I ought email the tech writer who wrote the man page ;)
   darix   as you like
   MartinCleaver   is there a better way of excluding the Status against revision line? That might break if future versions of SVN change the text
   MartinCleaver   I'll figure it out
   darix   MartinCleaver: that is the easiest way.
   darix   and you will notice if it changes.
   darix   and you should put a LC_ALL=POSIX
   darix   before the "svn st"
   darix   to be sure its always english
   darix   but i am sure you dont expect us to write the final script for you
   MartinCleaver   sure... I'll figure it out
   MartinCleaver   writes some code

-- MartinCleaver - 26 Nov 2005

Addressed in http://develop.twiki.org/~develop/cgi-bin/view/Bugs/Item1059

-- MartinCleaver - 27 Nov 2005

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2005-11-27 - MartinCleaver
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.