Provide --repository-url to ClearCase

Review Request #1505 — Created April 3, 2010 and submitted

Information

RBTools
master

Reviewers

In my company there is some custom access to vobs in dynamic view.
Difference is that there exist two assumptions:
1) We want ACL i old ClearCase so we do it on filesystem layer
2) Many users want to made their own dynamic view on unix system

This two assumptions follow to non standard clearcase dynamic view paths in
system. On filesystem looks like:

/view/user1_view/vobs
/view/user2_view/vobs
/view/user3_view/vobs

Now post review assume the path start from /vobs what is not true.
IMHO there is unused --repository-url parameter witch is perfect in meaning
to make customize "place of view == repository url" for clearcase.

--repository-url "/view/user1_view" 

will make the given as parameter path will be the prefix to /vobs. 
There is only one change. This parameter now works with --revision-range or
--diff-file. For clearcase they have sens also without any of this.
$ post-review -n -d --server "http://localhost:10000/" --repository-url "/view/user1_view/" index.wsgi
>>> svn info /view/user1_view/
>>> git rev-parse --git-dir
>>> hg root
>>> cleartool pwv -short
>>> repository info: Path: /view/reviewboard.diffview/vobs/, Base path: /view/reviewboard.diffview/vobs/, Supports changesets: False
>>> cleartool desc -pre /view/user1_view/vobs/SCM_tools/scripts/ReleaseRobot/index.wsgi
>>> cleartool desc -fmt %Vn /view/user1_view/vobs/SCM_tools
>>> cleartool desc -fmt %Vn /view/user1_view/vobs/SCM_tools/scripts
>>> cleartool desc -fmt %Vn /view/user1_view/vobs/SCM_tools/scripts/ReleaseRobot
--- /view/user1_view/vobs/SCM_tools/@@/main/int_02.04_GK/2/scripts/@@/main/6/ReleaseRobot/@@/main/3/index.wsgi/@@/main/int_02.04_GK/0   2002-02-21 23:30:39.942229878 -0800
+++ /view/user1_view/vobs/SCM_tools/scripts/ReleaseRobot/index.wsgi   2002-02-21 23:30:50.442260588 -0800
@@ -4,6 +4,8 @@

 from mako.lookup import TemplateLookup
 from werkzeug import Request
+
+# dummy checkout

 def bywwlistdir(directory, config):
     """Return directory sorted by work week"""


 post-review -d --server "http://localhost:10000/" --cc-root "/view/jkoprows_ccgsys" --repository-url "/view/jkoprows_ccgsys/vobs" index.wsgi
>>> svn info /view/jkoprows_ccgsys/vobs
>>> git rev-parse --git-dir
>>> hg root
>>> cleartool pwv -short
>>> repository info: Path: /view/jkoprows_ccgsys/vobs, Base path: /view/jkoprows_ccgsys/vobs, Supports changesets: False
>>> cleartool desc -pre /view/jkoprows_ccgsys/vobs/SCM_tools/scripts/ReleaseRobot/index.wsgi
>>> cleartool desc -fmt %Vn /view/jkoprows_ccgsys/vobs/SCM_tools
>>> cleartool desc -fmt %Vn /view/jkoprows_ccgsys/vobs/SCM_tools/scripts
>>> cleartool desc -fmt %Vn /view/jkoprows_ccgsys/vobs/SCM_tools/scripts/ReleaseRobot
>>> Looking for 'localhost /' cookie in /user/jkoprows/.post-review-cookies.txt
>>> Cookie file loaded, but no cookie for this server
==> Review Board Login Required
Enter username and password for Review Board at http://localhost:10000/
Username: admin
Password:
>>> Logging in with username "admin"
>>> HTTP POSTing to http://localhost:10000/api/json/accounts/login/: {'username': 'admin', 'password': '**************'}
>>> Logged in.
>>> Attempting to create review request on /view/jkoprows_ccgsys/vobs for None
>>> HTTP POSTing to http://localhost:10000/api/json/reviewrequests/new/: {'repository_path': '/view/jkoprows_ccgsys/vobs'}
>>> Review request created
>>> Attempting to set field 'description' to 'jkoprows_ccgsys
VIEWTYPE: dynamic
' for review request '2'
>>> HTTP POSTing to http://localhost:10000/api/json/reviewrequests/2/draft/set/: {'description': 'jkoprows_ccgsys\nVIEWTYPE: dynamic\n'}
>>> Uploading diff, size: 494
>>> HTTP POSTing to http://localhost:10000/api/json/reviewrequests/2/diff/new/: {'basedir': '/view/jkoprows_ccgsys/vobs'}
Review request #2 posted.

http://localhost:10000/r/2
jan.koprowski
jan.koprowski
DJ
  1. Looks good. You'll want to update the post-review doc in the reviewboard repo to reflect this change. I added some documentation a while back that explains how to hack your way through the hard-coded variables you removed here...
    1. I'll be happy to write some stuff about ClearCase usage model with ReviewBoard. My experiance in this manner growing day-to-day.
      But this depends how I should do this? Is this will be access to part of Your documentation, or send text to review in some format?
    2. You'll want to edit the reviewboard/docs/manual/users/tools/post-review.txt file in the Clearcase section. You can see the current doc online at http://www.reviewboard.org/docs/manual/dev/users/tools/post-review/
    3. I don't see it before. I will update that.
  2. 
      
chipx86
  1. 
      
  2. rbtools/postreview.py (Diff revision 2)
     
     
     
    Combine to one line.
  3. rbtools/postreview.py (Diff revision 2)
     
     
     
    Here too.
  4. rbtools/postreview.py (Diff revision 2)
     
     
    Can you rename this to --clearcase-root?
    
    I'd like to start getting post-review's SCM-specific arguments to be prefixed consistently with the SCM name. We'll need to do this for --label too, but it doesn't have to be this change (and we'd need backwards-compatibility anyway).
    1. No problem :) I will make parameters consist.
  5. rbtools/postreview.py (Diff revision 2)
     
     
     
    Make sure these wrap to 80 chars.
  6. rbtools/postreview.py (Diff revision 2)
     
     
     
     
     
     
     
     
    This logic (or something like it) needs to be preserved for Subversion. Probably belongs in the Subversion SCMClient somewhere.
    1. So... What I should to do? Add more logic? This condition will be huge!
    2. Sorry, missed this.
      
      Maybe have a SCMClient.check_options function that is called once we know the SCMClient. The existing code can move into the SVNClient.check_options, and then you should get what you want.
  7. 
      
jan.koprowski
chipx86
  1. 
      
  2. rbtools/postreview.py (Diff revision 3)
     
     
     
     
    We're actually not adding repository_url. We're adding clearcase_root_path.
    
    I'm confused as to the difference between these. Can you go over that? Do we really want both --clearcase-root and --repository-url, or just one?
    1. If we want to be clear ClearCase doesn't have something like repository at all. There is already big mess in ClearCase implementation so I can't understand why You still try to fix my patches. Please read ClearCase documentation updated by me and then You understand why.
  3. 
      
jan.koprowski
jan.koprowski
Review request changed
Change Summary:
--clearcase-root is no more subject of this review because was removed.
Summary:
Provide --repository-url and --cc-root for ClearCase
Provide --repository-url to ClearCase
david
  1. Committed as 3fabeeb. Thanks!
  2.