/stdhome

To get this branch, use:
bzr branch http://bzr.ed.am/stdhome

« back to all changes in this revision

Viewing changes to lib/stdhome/command/update.py

  • Committer: Tim Marston
  • Date: 2016-02-13 14:21:53 UTC
  • Revision ID: tim@ed.am-20160213142153-68g7pzq0au6bejep
fixed init command

Show diffs side-by-side

added added

removed removed

71
71
                                        raise the.program.FatalError(
72
72
                                                'invalid repository name: ' + optarg )
73
73
                                the.repo = optarg
74
 
                        elif opt in [ '--verbose', '-v' ]:
75
 
                                the.verbose += 1
76
74
                        elif opt == "--help":
77
75
                                self.print_help()
78
 
                
 
76
 
79
77
                # discard first argument (the command)
80
78
                args.pop( 0 )
81
79
 
97
95
                if the.repo.vcs.has_changes():
98
96
                        raise the.program.FatalError(
99
97
                                'repo has local changes: %s\n'
100
 
                                'Hint: see "%s stage-revert --help"' % 
 
98
                                'Hint: see "%s stage-revert --help"' %
101
99
                                ( the.repo.name, the.program.name ) )
102
100
 
103
101
                # copy-in changes to repo
104
 
                try:
105
 
                        deployment.copy_in()
106
 
                except deployment.CopyInConflicts as e:
107
 
                        raise the.program.FatalError(
108
 
                                'Files in %s differ too severly from %s:\n  %s\n' % \
109
 
                                ( the.home_dir, the.repo.dir, '\n  '.join( e.conflicts ) ) )
 
102
                deployment.copy_in()
110
103
 
111
104
                # perform vcs update
112
 
                if the.verbose: print "updating %s" % the.repo.dir
 
105
                if the.verbose >= 1: print "updating %s" % the.repo.dir
113
106
                updated_files = the.repo.vcs.update()
114
107
 
115
108
                message = ''
130
123
                if message:
131
124
                        raise the.program.FatalError(
132
125
                                'there were conflicts...\n' + message )
 
126
 
133
127
                # copy-out changes from repo
134
128
                deployment.copy_out()
135
129
 
136
130
                # now we've copied-out, revert any copied-in changes!
137
 
                if the.verbose: print "reverting %s" % the.repo.dir
 
131
                if the.verbose >= 1: print "reverting %s" % the.repo.dir
138
132
                the.repo.vcs.revert()