package com.gh4a.activities;

import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.ActionBar;

import com.gh4a.BaseActivity;
import com.gh4a.Constants;
import com.gh4a.R;
import com.gh4a.fragment.CommitListFragment;

public class CommitHistoryActivity extends BaseActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (hasErrorView()) {
            return;
        }

        setContentView(R.layout.generic_list);

        Bundle extras = getIntent().getExtras();
        String filePath = extras.getString(Constants.Object.PATH);

        if (savedInstanceState == null) {
            CommitListFragment fragment = CommitListFragment.newInstance(
                    extras.getString(Constants.Repository.OWNER),
                    extras.getString(Constants.Repository.NAME),
                    extras.getString(Constants.Object.REF),
                    filePath);

            FragmentManager fm = getSupportFragmentManager();
            fm.beginTransaction().add(R.id.content_container, fragment).commit();
        }

        ActionBar actionBar = getSupportActionBar();
        actionBar.setTitle(R.string.history);
        actionBar.setSubtitle(filePath);
    }
}
@@ -23,16 +23,47 @@
 ities;%0A%0A
+import android.content.Intent;%0A
 import a
@@ -289,16 +289,51 @@
 ragment;
+%0Aimport com.gh4a.utils.IntentUtils;
 %0A%0Apublic
@@ -384,16 +384,103 @@
 ivity %7B%0A
+    private String mRepoOwner;%0A    private String mRepoName;%0A    private String mRef;%0A%0A
     @Ove
@@ -808,25 +808,24 @@
 .PATH);%0A
-%0A
         
 if (save
@@ -820,135 +820,86 @@
     
-if (savedInstanceState == null) %7B%0A            CommitListFragment fragment = CommitListFragment.newInstance(%0A                   
+mRepoOwner = extras.getString(Constants.Repository.OWNER);%0A        mRepoName =
  ext
@@ -937,31 +937,23 @@
 ory.
-OWNER),%0A       
+NAME);%0A
         
     
@@ -940,36 +940,38 @@
 .NAME);%0A        
-    
+mRef =
  extras.getStrin
@@ -986,84 +986,147 @@
 nts.
-Repository.NAME),%0A                    extras.getString(Constants.Object.REF)
+Object.REF);%0A%0A        if (savedInstanceState == null) %7B%0A            CommitListFragment fragment = CommitListFragment.newInstance(mRepoOwner
 ,%0A  
@@ -1142,16 +1142,33 @@
         
+ mRepoName, mRef,
  filePat
@@ -1467,15 +1467,208 @@
 ePath);%0A
+        actionBar.setDisplayHomeAsUpEnabled(true);%0A    %7D%0A%0A    @Override%0A    protected Intent navigateUp() %7B%0A        return IntentUtils.getRepoActivityIntent(this, mRepoOwner, mRepoName, mRef);%0A
     %7D%0A%7D

Add back navigation to commit history activity.