Jump to content


unshelve -branch failing with "No target files in both client and branch view"

unshelve

  • Please log in to reply
9 replies to this topic

#1 daveg

daveg

    Member

  • Members
  • PipPip
  • 18 posts

Posted 17 January 2018 - 02:38 PM

When trying to unshelve shelved files between branches, I get "No target file(s) in both client and branch view.".

This is the command.....
% alias p416
/tool/s/packages/perforce-2016.1/bin/p4
% p416 unshelve -s 870973 -b soc_tb_main -n
No target file(s) in both client and branch view.

BTW, the unslelve works with this shelvelist intra-branch (w/o the - B)

The branch exists...
% p416 branches | egrep "sqf|soc_tb"
Branch soc_tb_main 2016/10/31 'Generated by Frank. codeline: soc_tb codeline_source_value: //soc/testbench/soc_tb/main '
Branch sqf_test 2017/12/19 ' codeline: soc_tb   codeline_source_value: //soc/testbench/soc_tb/main '

The WA I'm attempting this from is a sync to the sqf_test branch.  The shelvelist was generated in the soc_tb_main branch.  The soc_tb_main branch was created using P4 2011.  sqf_test is,I was told, a mapping from soc_tb_main to sqf_test.  Not sure about sqf_test with regard to version (how can I determine this?  Does it even matter ?).

I believe the "unslelve -b" is not supported in earlier versions of P4.  But note that I'm running the unshelve with 2016.  

I tried using "-b sqf_test" just for kicks, not expecting it to work because it's not the branch I'm trying to get the shelved files from.  I was right.  I got the same results.


I'm a novice at P4, so please be gentle :-)

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1014 posts

Posted 17 January 2018 - 05:50 PM

Run these and post the output:

p4 files @=870973
(all I really need from this one is to see which directory/branch the shelved files are in)

p4 client -o
(all I need from this is to see which directories/branches your client view maps)

p4 branch -o soc_tb_main
(all I need from this is to see which directories/branches your branch view maps)

and then I'll have some more questions for you.  :)

(If you haven't guessed, the command is failing because the three things I'm looking for in those commands are supposed to match up in certain ways, and it sounds like in this case they don't -- once I figure out where the mismatch is we can talk about what it is you're trying to do that's at odds with the way the views are set up.)

#3 daveg

daveg

    Member

  • Members
  • PipPip
  • 18 posts

Posted 17 January 2018 - 08:38 PM

% p4 files @=871509
//soc/testbench/soc_tb/main/src/examples/album.dj#1 - delete change 871509 (text)
//soc/testbench/soc_tb/main/src/examples/sqftest_add.this.file#none - add change 871509 (text)
//soc/testbench/soc_tb/main/src/examples/test_msg_user/README#1 - edit change 871509 (text)


% p4 client -o        
# A Perforce Client Specification.                                                            
#                                                                                            
#  Client:      The client name.                                                              
#  Update:      The date this specification was last modified.                                
#  Access:      The date this client was last used in any way.                                
#  Owner:       The Perforce user name of the user who owns the client                        
#               workspace. The default is the user who created the                            
#               client workspace.                                                            
#  Host:        If set, restricts access to the named host.                                  
#  Description: A short description of the client (optional).                                
#  Root:        The base directory of the client workspace.                                  
#  AltRoots:    Up to two alternate client workspace roots.                                  
#  Options:     Client options:                                                              
#                      [no]allwrite [no]clobber [no]compress                                  
#                      [un]locked [no]modtime [no]rmdir                                      
#  SubmitOptions:                                                                            
#                      submitunchanged/submitunchanged+reopen                                
#                      revertunchanged/revertunchanged+reopen                                
#                      leaveunchanged/leaveunchanged+reopen                                  
#  LineEnd:     Text file line endings on client: local/unix/mac/win/share.                  
#  ServerID:    If set, restricts access to the named server.                                
#  View:        Lines to map depot files into the client workspace.                          
#  Stream:      The stream to which this client's view will be dedicated.                    
#               (Files in stream paths can be submitted only by dedicated                    
#               stream clients.) When this optional field is set, the                        
#               View field will be automatically replaced by a stream                        
#               view as the client spec is saved.                                            
#  StreamAtChange:  A changelist number that sets a back-in-time view of a                    
#                   stream ( Stream field is required ).                                      
#                   Changes cannot be submitted when this field is set.                      
#                                                                                            
# Use 'p4 help client' to see more about client views and options.

Client: dgauthie_atl_mkwa_proj_scbu_infra_vol1_arden_er_dgauthie_SQFMAIN

Update: 2018/01/15 12:26:43

Access: 2018/01/17 15:34:40

Owner:  dgauthie

Description:
        Please do not touch any lines beginning with "template_" - these are used to manage your client templates.
        This client can be automatically deleted - please do not modify.
        template_branch: soc_tb_main
        template_type: default
        template_name: template_soc_tb_default
        template_update_time: 1477928913
        template_lines: 1
        template_branch: soc_tb_main
        template_type: default
        template_name: template_soc_tb_default_noperf
        template_update_time: 1497393339
        template_lines: 1
        Created by dgauthie.

Root:   /proj/scbu_infra_vol1/arden_er/dgauthie/SQFMAIN

Options:        noallwrite noclobber nocompress unlocked nomodtime rmdir

SubmitOptions:  revertunchanged

LineEnd:        local

View:
        //soc/testbench/soc_tb/main/... //dgauthie_atl_mkwa_proj_scbu_infra_vol1_arden_er_dgauthie_SQFMAIN/...
        -//soc/testbench/soc_tb/main/src/test/suites/soc/perf/... //dgauthie_atl_mkwa_proj_scbu_infra_vol1_arden_er_dgauthie_SQFMAIN/src/test/suites/soc/perf/...

p4 branch -o soc_tb_main
# A Perforce Branch Specification.
#
#  Branch:      The branch name.
#  Update:      The date this specification was last modified.
#  Access:      The date of the last 'integrate' using this branch.
#  Owner:       The user who created this branch.
#  Description: A short description of the branch (optional).
#  Options:     Branch update options: [un]locked.
#  View:        Lines to map source depot files to target depot files.
#
# Use 'p4 help branch' to see more about branch views.

Branch: soc_tb_main

Update: 2016/10/31 11:49:05

Access: 2018/01/17 10:30:16

Owner:  bgoodman

Description:
        Generated by the VMT support team.
        Created by bgoodman.
        codeline: soc_tb
        codeline_source_value: //soc/testbench/soc_tb/main

Options:        locked

View:
        //soc/testbench/soc_tb/main/... //soc/testbench/soc_tb/main/...

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1014 posts

Posted 17 January 2018 - 09:26 PM

This is an interesting branch view (I was surprised for a second that you were even allowed to make a no-op view like this, but I think the server only checks for the default branch view when it does that "this view does nothing" check):

 //soc/testbench/soc_tb/main/... //soc/testbench/soc_tb/main/... 

Where is this view supposed to be going?  Right now it just maps a branch onto itself, which is never going to do anything.

(edit) Oh, I see in your original post the branch you're trying to go to is called "sqf_test".  So here's what you need to change/do:

1) Run "p4 branch soc_to_sqf" and make a branch view that maps from soc_tb to sqf_test (modify this as needed if I guessed the path incorrectly):

Branch: soc_to_sqf (or whatever name)
View:
	//soc/testbench/soc_tb/main/... //soc/testbench/sqf_test/main/...

2) Run "p4 client" and switch your client view to map sqf_test (you could also make a whole new client, or expand this one to map both branches, but I'll just swap it over since that seems least confusing given your current setup):

View:
	//soc/testbench/sqf_test/main/... //dgauthie_atl_mkwa_proj_scbu_infra_vol1_arden_er_dgauthie_SQFMAIN/...
	-//soc/testbench/sqf_test/main/src/test/suites/soc/perf/... //dgauthie_atl_mkwa_proj_scbu_infra_vol1_arden_er_dgauthie_SQFMAIN/src/test/suites/soc/perf/...

3) Run "p4 sync" to sync your workspace with the branch you just switched the view to.

4) Run "p4 unshelve -s 870973 -b soc_to_sqf -n" to unshelve change 870973 (which has files in soc_tb) through the soc_to_swf branch view and patch it onto the revisions in swf_test that you have synced in your workspace.

#5 daveg

daveg

    Member

  • Members
  • PipPip
  • 18 posts

Posted 17 January 2018 - 11:35 PM

It doesn't like the p4 client changes... getting syntax errors.  This is what it looks like...


View:
//soc/testbench/sqf_test/main/... //dgauthie_atl_mkwa_proj_scbu_infra_vol1_arden_er_dgauthie_SQFMAIN/...
-//soc/testbench/sqf_test/main/src/test/suites/soc/perf/... //dgauthie_atl_mkwa_proj_scbu_infra_vol1_arden_er_dgauthie_SQFMAIN/src/test/suites/soc/perf/...

# //soc/testbench/soc_tb/main/... //dgauthie_atl_mkwa_proj_scbu_infra_vol1_arden_er_dgauthie_SQFMAIN/...
# -//soc/testbench/soc_tb/main/src/test/suites/soc/perf/... //dgauthie_atl_mkwa_proj_scbu_infra_vol1_arden_er_dgauthie_SQFMAIN/src/test/suites/soc/perf/...


(I commented out the ones that were already there)

#6 daveg

daveg

    Member

  • Members
  • PipPip
  • 18 posts

Posted 17 January 2018 - 11:37 PM

Sorry, I whould have put the whole error msg...

Error in client specification.
Error detected at line 66.
Syntax error in '//soc/testbench/sqf_test/main/...'.
Hit return to continue...
Error in client specification.
Error detected at line 66.
Syntax error in '//soc/testbench/sqf_test/main/...'.

The line after the "View" is line 66

#7 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1014 posts

Posted 17 January 2018 - 11:47 PM

Sounds like your editor added a linebreak?  Both halves of the view mapping need to go on the same line.

//depot/path/... //client/path/...
^ one line!

Also note that each line of a multi-line field (e.g. the View) needs to be indented.  An unindented line marks a new field.  (Edited previous post to reflect this -- didn't expect you to copy and paste straight from there.  Did I actually guess the path correctly?)

(If not, or if you're not sure what I'm talking about by the "correct path", STOP and ask some questions about that before things get really confusing.  :)  i'm kinda trying to help you drive without being able to see the road here and I'm a little worried about crashing you into a tree.)

#8 daveg

daveg

    Member

  • Members
  • PipPip
  • 18 posts

Posted 18 January 2018 - 02:10 PM

See next post

#9 daveg

daveg

    Member

  • Members
  • PipPip
  • 18 posts

Posted 18 January 2018 - 03:29 PM

SUCCESS !!!!

The to-from mapping in the branch definition wasn't right (my bad, you warned me earlier when you said "modify this as needed if I guessed the path incorrectly")
I think I finally understand what's going on.  When one says...
    "p4 unshelve -c 1234 -b somebranch"
what they're really saying is...
    unshelve the changes in CL# 1234 which you will find in the area identified as the "from" part of the mapping specified in branch 'somebrahch' "

I was confusing the idea of a branch being akin to some subset of a depot (soc_tb or sqf_test in my case) when it's really a mapping definition between the two.

Thanks Again for all the help Sambwise.

(got to take all this down in my notes :-) )

#10 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1014 posts

Posted 18 January 2018 - 09:24 PM

Yeah, branch specs are pretty confusingly named being that they aren't actually one-to-one with branches.  This has been confusing people for twenty years.  :)  One really positive thing streams did for making Perforce branching easier to understand is that each "stream" spec actually represents one stream (branch), and the branch views associating them are computed automatically.

Quote

unshelve the changes in CL# 1234 which you will find in the area identified as the "from" part of the mapping

It works in the other direction too; if the shelved files are on the right hand side of the mapping, "unshelve -b" just maps them to the left side and opens the files there.  (It's similar to using the "-s" flag on integrate -- since you specified the source explicitly, in this case via the shelved change, Perforce can infer the direction in which to apply the mapping.)





Also tagged with one or more of these keywords: unshelve

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users